Possible Duplicate:
Magic functions __call() for functions?
I can implement __call() to provide method_missing behavior in PHP classes. Is there some way to provide the same functionality in the global scope?
I want something like this:
function __call( $name, $arguments ) {
echo( sprintf( '%s called', $name ) );
}
echo( 'before' );
call_undefined_function( $a, $b );
echo( 'after' );
Outputs:
before
call_undefined_function called
after