|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-10-27 14:51 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 20:00:01 2025 UTC |
Description: ------------ Converting of object to string does not work properly. The code below explains all. Reproduce code: --------------- <?php class Foo { function __toString() { return "What ever"; } } $obj = new Foo; $str = (string) $obj; // call __toString() echo $obj; // call __toString(), prints "What ever", it's good print $str; // prints "Object id #1" it's not good ?>