php-src/Zend/tests/qm_assign_ref_unwrap_leak.phpt
Nikita Popov fbae590bf0 Fix leaks in QM_ASSIGN, JMP_SET and COALESCE
The QM_ASSIGN code was rewritten to use the standard pattern for
handling CVs and VARs.
2016-05-03 18:12:56 +02:00

21 lines
308 B
PHP

--TEST--
Leak in QM_ASSIGN when unwrapping references (rc=1)
--FILE--
<?php
function &ref() {
$str = "str";
$str .= "str";
return $str;
}
var_dump(true ? ref() : ref());
var_dump(ref() ?: ref());
var_dump(ref() ?? ref());
?>
--EXPECT--
string(6) "strstr"
string(6) "strstr"
string(6) "strstr"