Skip to content

Commit e069032

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Property handle read_property exception in fetch_property_address
2 parents 00edc3f + 247105a commit e069032

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--TEST--
2+
Exception thrown by __get() during =& assignment
3+
--FILE--
4+
<?php
5+
6+
class Test {
7+
private $x;
8+
public function &__get($name) {
9+
throw new Exception("Foobar");
10+
}
11+
}
12+
13+
$test = new Test;
14+
$y = 5;
15+
try {
16+
$test->x =& $y;
17+
} catch (Exception $e) {
18+
echo $e->getMessage(), "\n";
19+
}
20+
21+
?>
22+
--EXPECT--
23+
Foobar

Zend/zend_execute.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2783,6 +2783,10 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c
27832783
}
27842784
goto end;
27852785
}
2786+
if (UNEXPECTED(EG(exception))) {
2787+
ZVAL_ERROR(result);
2788+
goto end;
2789+
}
27862790
} else if (UNEXPECTED(Z_ISERROR_P(ptr))) {
27872791
ZVAL_ERROR(result);
27882792
goto end;

0 commit comments

Comments
 (0)