Skip to content

Conversation

@camporter
Copy link
Contributor

Addresses bug 81611.
I'm a bit unsure on whether there's a better way to do this though...

cc @nikic

switch (fetch_sub_type) {
case ZEND_FETCH_CLASS_SELF:
scope = zend_get_executed_scope();
if (scope == NULL) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could get into trouble here if the expression is supposed to be evaluated at global scope, in which case scope will be NULL and will fall back to the executed scope here. So we'd have to distinguish an explicit scope vs the fallback to the executed scope separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, forgot about global being NULL. Seems like the signature should allow providing the explicit vs execution scope? I'm out of my depth though so feel free to change/modify this.

@nikic nikic closed this in 812df2b Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants