【发布时间】:2010-09-08 17:28:51
【问题描述】:
我可以实现 __call() 以在 PHP 类中提供 method_missing 行为。有没有办法在全局范围内提供相同的功能?
我想要这样的东西:
function __call( $name, $arguments ) {
echo( sprintf( '%s called', $name ) );
}
echo( 'before' );
call_undefined_function( $a, $b );
echo( 'after' );
输出:
before
call_undefined_function called
after
【问题讨论】:
-
别担心 - 我找到它只是因为我回答了它......
标签: php oop method-missing