Re: [PATCH] __toString()

From: Date: Fri, 27 Jan 2006 16:44:53 +0000
Subject: Re: [PATCH] __toString()
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-21707@lists.php.net to get a copy of this message
The pecl package 'operator' (http://pecl.php.net/package/operator) sounds like what you might be looking for.
Wow, great! All I have to do is to implement a __assign_concat() method? Yep, atm you can refer to the test files included in the package (no other docs yet).
Patrick also blogged up a nice summary: http://blog.ghostwhowalksinside.org/archives/2006/programming/php/operator-magic which includes objectified string handling and one particularly frightening use of the mod operator...
Why this is not in the core? Because PHP is not C++ :) Not to mention this is about two weeks old and very experimental. :)
And what is 'Plan A'? ;) There are two ways to ask an object for a property. Either is sufficient for operator's needs, but the first version is preferred since it's less likely to cause an unnecessary duplication.
-Sara

« previous php.internals (#21707) next »