The function doesn't have access to the variables $test, $host, $user, and $accesshash etc.
You can use the global keyword to get the vars from the global scope
PHP Code:
<?
function xxx(){
global $test, $host, $user, $accesshash;
$bob = $test->adding($host,$user,$accesshash);
}
?>
or pass in the vars as arguments to the function:
PHP Code:
<?
function xxx($test, $host, $user, $accesshash){
$bob = $test->adding($host,$user,$accesshash);
}
?>
But you should read up on your variable scope. It's a basic part of programming PHP.