|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-11-06 14:26 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 23 05:00:01 2025 UTC |
Description: ------------ Object that do not implement __toString, now stop the script with "PHP Catchable fatal error: Object of class {className} could not be converted to string in ..." But for backward compatibility, if __toString is not implemented, it should return the old object id value, or the name of class of the object for example. I agree that nobody can rely on old ObjectId string, but there?s thousand scripts that stringfy data for logging, like this: function log($vars) { foreach($vars as $var) echo $var; } function test($a, $b) { log(func_get_args()); } Reproduce code: --------------- class Foo { } echo new Foo; Expected result: ---------------- Old behavior of conversion from object to string Actual result: -------------- Catchable fatal error: Object of class Foo could not be converted to string in ...