Download src/php/php-src/Zend/tests/call_user_functions/bug66719.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 854 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/call_user_functions/bug66719.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/call_user_functions/bug66719.phpt
-
curl -L -o bug66719.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/call_user_functions/bug66719.phpt
854 Bytes
| --TEST-- | |
| Bug #66719: Weird behaviour when using get_called_class() with call_user_func() | |
| --FILE-- | |
| class A | |
| { | |
| public static function who() | |
| { | |
| var_dump(get_called_class()); | |
| } | |
| } | |
| class B extends A | |
| { | |
| public static function who() | |
| { | |
| parent::who(); | |
| } | |
| } | |
| class C | |
| { | |
| public static function test() { | |
| B::who(); | |
| call_user_func(array(A::class, 'who')); | |
| call_user_func(array(B::class, 'parent::who')); | |
| } | |
| } | |
| B::who(); | |
| call_user_func(array(A::class, 'who')); | |
| call_user_func(array(B::class, 'parent::who')); | |
| C::test(); | |
| --EXPECTF-- | |
| string(1) "B" | |
| string(1) "A" | |
| Deprecated: Callables of the form ["B", "parent::who"] are deprecated in %s on line %d | |
| string(1) "A" | |
| string(1) "B" | |
| string(1) "A" | |
| Deprecated: Callables of the form ["B", "parent::who"] are deprecated in %s on line %d | |
| string(1) "A" | |