Uh oh!
There was an error while loading. Please reload this page.
Fix Exception constructor optimization after https://github.com/php/php-src/pull/18442 - #18719
Conversation
- Property hooks may now throw exceptions, that seem to be forgotten to be handled - The $previous and $trace properties are private, and they were not accessible from the constructor of a child class
06357db to
a259d88Compare| ?> | ||
| --EXPECTF-- | ||
| string(3) "bar" | ||
| int(1) |
There was a problem hiding this comment.
The tests may be a little complicated, but I tried to make it visible that properties are now not modified after an exception is thrown (the $code property remains 1, instead of 2 etc.)
Good find. I don't really like the fact that we need to check for exceptions, I don't think it would be a big deal to not do this. (but probably best to do this anyway for consistency) |
Yes, not a huge issue, but I agree with the consistency stuff. Also, the
|
ndossche
commented
May 31, 2025
I'll pull and play with this in a bit |
kocsismate
commented
May 31, 2025
Yes, feel free to push directly to this branch if something needs to be changed. |
These property writes may now throw exceptions because of property hooks, and this was not handled previously.
* PHP-8.4: Backport relevant changes of #18719
$previousand$traceproperties are private, and they were not accessible from the constructor of a child class