I came a cross some problems, which were caused by PHPTAS relying on the
__toString() magic method, when converting objects to strings.
First problem: Exceptions can´t be thrown within __toString(), see:
Second problem: __toString() is not correctly implemented in PHP <
5.2.0, so that on a test server with an older PHP version, the output is
Both problems are very easy to work around: The method __toString() has
to be called explicitly instead of letting PHP do the magic work.
Here is, how I extended the phptal_tostring() and phptal_escape()
functions to implement this workaround (3 small changes):
Is there a good reason not to include this kind of workaround into PHPTAL?
PHPTAL mailing list