From 4463acb9513dfb62206760c49b3da1fe4d92f40a Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 10 Oct 2019 14:41:35 +0200 Subject: 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. --- tests/classes/static_properties_003_error4.phpt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'tests') 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== -- cgit v1.2.1