TravisSwicegood.com

1 November

Pushing the boundries of PHP

You must be doing something right when you can send PHP into a tail spin. That or the code you're trying to do is just evil. Turns out __destruct() and __call() don't play well together in 5.2.4 if, and only if, you create an instance of an object without assigning it.

I ran into this when I coded this up:

ensure('foobar')->equals('barfoo');

It's for a secret project... ;-)

Check the full bug for more info.

4 comments

That line looks very exciting!
Or doing something very wrong, like throwing exceptions from __destruct().. :D
@jani: nope - I was actually trying to catch the Exception. Something about being in __destruct() and an Exception getting thrown at all is what seems to be freaked PHP out, but only in the __call() case in the PHPT file.
Gee, seems like we are going to have super cool mocks in SimpleTest quite soon ;)

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)