1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/Zend/tests/exit/exit_as_function.phpt
Ilija Tovilo 28fd7597ba Add first-class callable cache
This cache is implemented in two levels: A EG(callable_convert_cache) global
that maps zend_function pointers to a shared callable instance, and a
CALLABLE_CONVERT cache slot to remember the result of the hash table lookup.

Fixes GH-19754
Closes GH-19863
2025-10-03 01:04:56 +02:00

43 lines
549 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);
}
?>
--EXPECTF--
string(4) "exit"
string(3) "die"
object(Closure)#%d (2) {
["function"]=>
string(4) "exit"
["parameter"]=>
array(1) {
["$status"]=>
string(10) "<optional>"
}
}
object(Closure)#%d (2) {
["function"]=>
string(4) "exit"
["parameter"]=>
array(1) {
["$status"]=>
string(10) "<optional>"
}
}