Edit report at http://bugs.php.net/bug.php?id=53858&edit=1
ID: 53858 Updated by: scott...@php.net Reported by: alok at fb dot com Summary: infinite loop in __tostring() causes seg fault Status: Open Type: Bug Package: Class/Object related Operating System: All PHP Version: 5.3.5 Block user comment: N Private report: N New Comment: This is a crash in stock PHP 5.2 too, Our version in APE has a patch that adds fb.recursion_max and overrides zend_execute to do the counting. Previous Comments: ------------------------------------------------------------------------ [2011-01-27 19:01:25] alok at fb dot com 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 this bug report at http://bugs.php.net/bug.php?id=53858&edit=1