mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
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
43 lines
549 B
PHP
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>"
|
|
}
|
|
}
|