note 58690 rejected from language.oop5.magic by betz
| From: | betz@php.net | Date: | Sat, 12 Nov 2005 08:23:05 +0000 |
| Subject: | note 58690 rejected from language.oop5.magic by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-98453@lists.php.net to get a copy of this message | ||
Note Submitter: junggle at centrum dot cz
----
why is __toString() only triggered by echo command?
i would expect it to be triggered everytime the object is
actually converted to string type.
wouldn't it be cool if it worked like this? :
$mydate = &new MyDateClass(2005, 11, 12);
$output = 'the date is '.$mydate.' and ...';
-jj