1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/exit/exit_as_function.phpt

43 lines
542 B
PHP

--TEST--
exit() as function
--FILE--
<?php
function foo(callable $fn) {
var_dump($fn);
}
$values = [
'exit',
'die',
exit(...),
die(...),
];
foreach ($values as $value) {
foo($value);
}
?>
--EXPECT--
string(4) "exit"
string(3) "die"
object(Closure)#1 (2) {
["function"]=>
string(4) "exit"
["parameter"]=>
array(1) {
["$code"]=>
string(10) "<optional>"
}
}
object(Closure)#2 (2) {
["function"]=>
string(4) "exit"
["parameter"]=>
array(1) {
["$code"]=>
string(10) "<optional>"
}
}