mirror of
https://github.com/php/php-src.git
synced 2024-11-30 21:35:36 +08:00
Merge branch 'PHP-7.4'
* PHP-7.4: Property handle read_property exception in fetch_property_address
This commit is contained in:
commit
e069032e5c
23
Zend/tests/exception_during_by_reference_magic_get.phpt
Normal file
23
Zend/tests/exception_during_by_reference_magic_get.phpt
Normal file
@ -0,0 +1,23 @@
|
||||
--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
|
@ -2783,6 +2783,10 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c
|
||||
}
|
||||
goto end;
|
||||
}
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
ZVAL_ERROR(result);
|
||||
goto end;
|
||||
}
|
||||
} else if (UNEXPECTED(Z_ISERROR_P(ptr))) {
|
||||
ZVAL_ERROR(result);
|
||||
goto end;
|
||||
|
Loading…
Reference in New Issue
Block a user