Use Global
:
# need $a and $b vars here!
global $a;
global $b;
// Use them here!
or even shorter:
global $a, $b;
Or use $GLOBALS[]
like this:
echo $GLOBALS['a'];
echo $GLOBALS['b'];
http://www.php.net/manual/en/language.variables.scope.php
And you can pass them ofcourse like this:
function errhnd($a = NULL, $b= NULL, $errno, $errstr, $errfile, $errline) {
# need $a and $b vars here!
}
set_error_handler($a, $b, 'errhnd');