NYCPHP Meetup

NYPHP.org

[nycphp-talk] overriding strval(x)?

Adam Maccabee Trachtenberg adam at trachtenberg.com
Fri Jan 23 00:27:50 EST 2004


On Thu, 22 Jan 2004, jon baer wrote:

> when oo-ing your code is there anyway to override the strval() function if
> its being performed on your object?  in java its likened to having a known
> function (toString()) but if someone decided to debug an object in php can
> they do something similar to the same so u can see ur variable sets?

In PHP 5, there's a __toString() method. Also, have you tried doing
foreach on the object?

-adam

-- 
adam at trachtenberg.com
author of o'reilly's php cookbook
avoid the holiday rush, buy your copy today!



More information about the talk mailing list