Skip to content

Conversation

bwoebi
Copy link
Member

@bwoebi bwoebi commented Oct 7, 2025

While I consider it fine to hardcode offsets for parent-less classes, doing it on inherited classes prohibits adding additional properties via extensions. In this specific case, an added property to Exception will cause "new ErrorException" to crash.

Technically, it's possible to work around this issue via a fake hooked property, to bypass the offset-access.
But that's quite hacky, and it would be much simpler to just not do that type of optimization on properties defined on child classes.

While I consider it fine to hardcode offsets for parent-less classes, doing it on inherited classes prohibits adding additional properties via extensions.
In this specific case, an added property to Exception will cause "new ErrorException" to crash.

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
@bwoebi bwoebi merged commit 53b0a95 into php:PHP-8.5 Oct 7, 2025
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants