php-src/Zend/tests/exception_during_by_reference_magic_get.phpt
Nikita Popov 247105ae1a Property handle read_property exception in fetch_property_address
Otherwise we leak (and corrupt uninitialized_zval).
2020-08-26 16:12:34 +02:00

24 lines
321 B
PHP

--TEST--
Exception thrown by __get() during =& assignment
--FILE--
<?php
class Test {
private $x;
public function &__get($name) {
throw new Exception("Foobar");
}
}
$test = new Test;
$y = 5;
try {
$test->x =& $y;
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Foobar