Download src/php/php-src/Zend/tests/arrow_functions/gh7900.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 436 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/arrow_functions/gh7900.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/arrow_functions/gh7900.phpt
-
curl -L -o gh7900.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/arrow_functions/gh7900.phpt
436 Bytes
| --TEST-- | |
| GH-7900: Arrow function with never return type compile-time errors | |
| --INI-- | |
| zend.assertions=1 | |
| assert.exception=1 | |
| --FILE-- | |
| $x = fn(): never => throw new \Exception('Here'); | |
| try { | |
| var_dump($x()); | |
| } catch (\Exception $e) { | |
| echo $e->getMessage(), "\n"; | |
| } | |
| try { | |
| assert((fn(): never => 42) && false); | |
| } catch (\Error $e) { | |
| echo $e->getMessage(), "\n"; | |
| } | |
| --EXPECT-- | |
| Here | |
| assert(fn(): never => 42 && false) | |