1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 17:52:16 +01:00
Files
archived-php-src/ext/opcache/tests/wrong_inlining_005.phpt
Nikita Popov 5f4f83220a Don't inline if function has ref arguments
Otherwise we end up leaving opcodes like FETCH_DIM_W behind. The
test case demonstrates a leak in particular.
2016-11-12 18:49:41 +01:00

23 lines
261 B
PHP

--TEST--
Inlining of functions with ref arguments
--FILE--
<?php
function by_ref(&$var)
{
}
function &get_array() {
$array = [new stdClass];
return $array;
}
function test()
{
by_ref(get_array()[0]);
print "ok!\n";
}
test();
?>
--EXPECT--
ok!