summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-10-10 14:41:35 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-10-10 14:41:35 +0200
commit4463acb9513dfb62206760c49b3da1fe4d92f40a (patch)
tree8726b06b7cfb6c114b46e838d9e931217d5b90f8 /tests
parent12f4e9e020c3968c5a201ef96c4ee589ad36e5e5 (diff)
downloadphp-git-4463acb9513dfb62206760c49b3da1fe4d92f40a.tar.gz
Explicitly check for exceptions in by-ref obj prop assign
Relying on setting ERROR if an exception happened during the property address fetch is both a bit fragile and may pessimize other codepaths that will check for exceptions in the VM. Adding an extra exception check instead, which should also allow us to drop the use of ERROR in this area in master.
Diffstat (limited to 'tests')
-rw-r--r--tests/classes/static_properties_003_error4.phpt13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/classes/static_properties_003_error4.phpt b/tests/classes/static_properties_003_error4.phpt
index 6a4eafcd2a..7c54fc42ad 100644
--- a/tests/classes/static_properties_003_error4.phpt
+++ b/tests/classes/static_properties_003_error4.phpt
@@ -8,17 +8,20 @@ class C {
$c = new C;
echo "\n--> Access non-visible static prop like instance prop:\n";
-$c->y =& $ref;
+try {
+ $c->y =& $ref;
+} catch (Error $e) {
+ echo $e, "\n";
+}
?>
==Done==
--EXPECTF--
--> Access non-visible static prop like instance prop:
-
-Fatal error: Uncaught Error: Cannot access protected property C::$y in %s:8
+Error: Cannot access protected property C::$y in %s:9
Stack trace:
#0 {main}
-Next Error: Cannot access protected property C::$y in %s:8
+Next Error: Cannot access protected property C::$y in %s:9
Stack trace:
#0 {main}
- thrown in %s on line 8
+==Done==