Hallo, test
Wieso functioniert dritte Variante nicht?
PHP-Code:
ini_set('display_errors',1);
echo microtime(1),'<p>';
class A {
private static $f = NULL;
public static function __callStatic( $name, $args = NULL ) {
if( count( $args ) ) { self::$f = function( ) { echo '<h1>function is called!</h1>'; }; echo 'function is geted'; return; }
echo '<br>is_callable = ', ( int )is_callable( self::$f );
$a = self::$f; $a( );// functioniert
call_user_func( self::$f );// functioniert
self::$f( );// functioniert NICHT
}
}
Kommentar