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

restoreAll() crashes with wildcards, multiple methods #33

Closed
cmounce opened this issue Feb 5, 2016 · 1 comment
Closed

restoreAll() crashes with wildcards, multiple methods #33

cmounce opened this issue Feb 5, 2016 · 1 comment

Comments

@cmounce
Copy link

cmounce commented Feb 5, 2016

If you pass a wildcard Foo::* to redefine(), and class Foo has multiple public methods, then restoreAll() will crash.

I have a demonstration in this Gist. This is the output on my computer:

$ php main.php
You called the original bar()
You called the redefined bar()
PHP Fatal error:  Call to a member function expire() on null in /home/cmounce/Downloads/patchwork-wildcard/vendor/antecedent/patchwork/src/CallRerouting.php on line 192

The Gist attempts to redefine bar(), then restore it. The redefine works, but the restore crashes.

@cmounce
Copy link
Author

cmounce commented Feb 23, 2016

Works now, thanks!

@cmounce cmounce closed this as completed Feb 23, 2016
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

No branches or pull requests

1 participant