From: Operating system: All PHP version: 5.3.5 Package: Class/Object related Bug Type: Bug Bug description:infinite loop in __tostring() causes seg fault
Description: ------------ The following piece of code would cause "PHP Fatal error: [php_fb]: call depth has exceeded the maximum recursion setting of 500!, eject! eject! eject!..." in 5.2.5. However, on versions 5.3.3 and 5.3.5, I am seeing a segmentation fault. Test script: --------------- <?php class A { public function __toString() { (string)$this; } } (string)new A(); Expected result: ---------------- "PHP Fatal error: [php_fb]: call depth has exceeded the maximum recursion setting of 500!, eject! eject! eject!..." seems a reasonable result. Actual result: -------------- segmentation fault -- Edit bug report at http://bugs.php.net/bug.php?id=53858&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53858&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53858&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53858&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53858&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53858&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53858&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53858&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53858&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53858&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53858&r=support Expected behavior: http://bugs.php.net/fix.php?id=53858&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53858&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53858&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53858&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53858&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53858&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53858&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53858&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53858&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53858&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53858&r=mysqlcfg