Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forget the name of the global functions on restore #28

Merged
merged 1 commit into from
Feb 8, 2022

Conversation

mehamasum
Copy link
Contributor

Fixes #27

When a new global function is defined, we skip if the function has been defined already (by looking at self::$global_functions).
But we don't clear the memory when the original definition is restored, so after restoration, re-defining doesn't work because the name is found self::$global_functions.

When a new global function is defined, we skip if the function has been
defined already (by looking at self::$global_functions).
But they don't clear the memory when the original definition is restored,
so after restoration, re-defining doesn't work because the name is found self::$global_functions.
Copy link
Owner

@sirbrillig sirbrillig left a comment

Choose a reason for hiding this comment

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

That seems reasonable to me! It's been a long time since I worked on this behavior, but I wonder why this variable wasn't cleared before? It was likely just an oversight.

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.

Stubbed global function can not be re-stubbed after finish_spying
2 participants