Download src/php/php-src/Zend/tests/dynamic_call/bug77877.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 464 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/dynamic_call/bug77877.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/dynamic_call/bug77877.phpt
-
curl -L -o bug77877.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/dynamic_call/bug77877.phpt
464 Bytes
| --TEST-- | |
| Bug #77877 call_user_func() passes $this to static methods | |
| --FILE-- | |
| class Foo { | |
| static public function bar() { | |
| var_dump($this); | |
| } | |
| } | |
| try { | |
| array_map([new Foo, 'bar'],[1]); | |
| } catch (Throwable $e) { | |
| echo $e->getMessage() . "\n"; | |
| } | |
| try { | |
| call_user_func([new Foo, 'bar']); | |
| } catch (Throwable $e) { | |
| echo $e->getMessage() . "\n"; | |
| } | |
| --EXPECT-- | |
| Using $this when not in object context | |
| Using $this when not in object context | |