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

Chain class method call #151

Closed
taylorren opened this Issue Dec 15, 2014 · 0 comments

Comments

Projects
None yet
2 participants
@taylorren
Copy link

taylorren commented Dec 15, 2014

Further to my issue submitted: #150, I seeking support on how to chain class method calls.

A complex class defined will have member methods like add(), sub(). Since PHP does not support operator overridden yet, the best way to do a complex manipulation is like:

$res=$a->add($b)->sub($c);

This chain of class method call will always return a segmentation fault.

Source code of the complex class can be found in my previous issue.

Any hint will be of great help.

EmielBruijntjes added a commit that referenced this issue Dec 16, 2014

fix issue #151, chaining method calls was not working as it should be…
…cause the per-object refcount was not updated correctly, which caused an object to be destructed even when it already was assigned to a different variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.