|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-05-06 02:33 UTC] php at koteroff dot ru
[2004-05-06 06:20 UTC] amt@php.net
[2004-05-07 03:36 UTC] php at koteroff dot ru
[2004-05-07 17:08 UTC] amt@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 17 13:00:01 2025 UTC |
Description: ------------ Method __toString() work in PHP5 RC1 correctly, but in PHP4 RC2 - wrong (in today CVS - too). Bewitched method? :-) There are so many bugs and changes around them in all PHP versions... I'm finishing the book about PHP5, please say if __toString() behavour will be changed in release. P.S. I cannot understand too why this method is called only in print and echo functions - thanks to it I cannot write function myecho($s) { echo $s; } myecho("x=$x"); But, I think, it is another question. Reproduce code: --------------- <? class C { function __toString() { return "s"; } } $x = new C; echo "x=$x"; ?> Expected result: ---------------- x=s Actual result: -------------- x=Object id #1 (and NO warning or notice)