php-src/Zend/tests/temporary_cleaning_017.phpt
Dmitry Stogov 8258b7731b Fix memory leak
Fixes oss-fuzz #51622
2022-09-26 11:43:38 +03:00

24 lines
472 B
PHP

--TEST--
Live range & free on return & TMP var of RETURN opcode
--FILE--
<?php
class bar{
public $y;
function __destruct() {
y;
}
}
foreach(new bar as $y) {
try {
return new Exception;
} catch(y) {
}
}
?>
--EXPECTF--
Fatal error: Uncaught Error: Undefined constant "y" in %stemporary_cleaning_017.php:5
Stack trace:
#0 %stemporary_cleaning_017.php(10): bar->__destruct()
#1 {main}
thrown in %stemporary_cleaning_017.php on line 5