#45387 [Opn->Fbk]: (string)$obj on objects w/o __toString() behaves differently

From: Date: Wed, 02 Jul 2008 02:21:53 +0000
Subject: #45387 [Opn->Fbk]: (string)$obj on objects w/o __toString() behaves differently
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-126171@lists.php.net to get a copy of this message
ID: 45387 Updated by: felipe@php.net Reported By: tswicegood@php.net -Status: Open +Status: Feedback Bug Type: *General Issues Operating System: OS X PHP Version: 5.3CVS-2008-06-28 (CVS) New Comment: Please try using this CVS snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows (zip): http://snaps.php.net/win32/php5.3-win32-latest.zip For Windows (installer): http://snaps.php.net/win32/php5.3-win32-installer-latest.msi I can't reproduce. Previous Comments: ------------------------------------------------------------------------ [2008-06-28 17:42:45] tswicegood@php.net Description: ------------ In PHP 5.2.x calling (string)$object on an object w/o the __toString() method would cause a catchable fatal error and would halt execution. In PHP 5.3, the error is thrown but execution continues. This is the same behavior as PHP 5.1.4 - 5.1.6 (may be true for older versions as well, but I only tested back to 5.1.4). Reproduce code: --------------- <?php $o = new StdClass(); @(string)$o; echo "OK"; Expected result: ---------------- Unsure - possibly OK, possibly nothing. I'm not sure if 5.2.x or 5.1/5.3 behavior is correct. Actual result: -------------- OK ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45387&edit=1

« previous php.bugs (#126171) next »