Download src/php/php-src/Zend/tests/closures/closure_033.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 557 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/closures/closure_033.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/closures/closure_033.phpt
-
curl -L -o closure_033.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/closures/closure_033.phpt
557 Bytes
| --TEST-- | |
| Closure 033: Dynamic closure property and private function | |
| --FILE-- | |
| class Test { | |
| public $func; | |
| function __construct() { | |
| $this->func = function() { | |
| echo __METHOD__ . "()\n"; | |
| }; | |
| } | |
| private function func() { | |
| echo __METHOD__ . "()\n"; | |
| } | |
| } | |
| $o = new Test; | |
| $f = $o->func; | |
| $f(); | |
| $o->func(); | |
| ===DONE=== | |
| --EXPECTF-- | |
| {closure:%s:%d}() | |
| Fatal error: Uncaught Error: Call to private method Test::func() from global scope in %s:%d | |
| Stack trace: | |
| #0 {main} | |
| thrown in %sclosure_033.php on line %d | |