ID: 39392 Updated by: [EMAIL PROTECTED] Reported By: marcos dot neves at gmail dot com -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: ANY PHP Version: 5.2.0 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php See upgrade info Previous Comments: ------------------------------------------------------------------------ [2006-11-05 23:23:27] marcos dot neves at gmail dot com 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 ... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39392&edit=1