1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 08:28:26 +02:00
Files
archived-php-src/Zend/tests/first_class_callable/first_class_callable_optimization.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

22 lines
327 B
PHP

--TEST--
Check interaction of first-class callables with optimization
--FILE--
<?php
function test1() {}
function test2() { return 42; }
var_dump(test1(...));
var_dump(test2(...));
?>
--EXPECTF--
object(Closure)#%d (1) {
["function"]=>
string(5) "test1"
}
object(Closure)#%d (1) {
["function"]=>
string(5) "test2"
}