|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2014-05-21 16:52 UTC] johannes@php.net
 
-Status: Open
+Status: Not a bug
  [2014-05-21 16:52 UTC] johannes@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 22:00:01 2025 UTC | 
Description: ------------ Error with an infinite recursion in __toString(). I get in CLI: Segmentation fault When I try execute this code in php-fpm, then I get an error in fpm log: [21-May-2014 16:41:48] WARNING: [pool logic] child 8686 exited on signal 11 (SIGSEGV) after 957.896252 seconds from start Test script: --------------- class foo { public $parent = null; public function __toString() { return sprintf('some %s', $this->public); } } $test = new \foo(); $test->public = $test; echo $test; Expected result: ---------------- Fatal error: Maximum function nesting level of '500' reached, aborting! in /home /sysanin/test.php on line 5 Call Stack: 0.0002 118064 1. {main}() /home/sysanin/test.php:0 0.0003 118372 2. foo->__toString() /home/sysanin/test.php:12 0.0003 118428 3. sprintf() /home/sysanin/test.php:6 0.0003 118720 4. foo->__toString() /home/sysanin/test.php:6 0.0003 118776 5. sprintf() /home/sysanin/test.php:6 0.0003 119068 6. foo->__toString() /home/sysanin/test.php:6 0.0003 119136 7. sprintf() /home/sysanin/test.php:6 0.0003 119428 8. foo->__toString() /home/sysanin/test.php:6 ... 0.0015 203708 493. sprintf() /home/sysanin/test.php:6 0.0015 204000 494. foo->__toString() /home/sysanin/test.php:6 0.0015 204056 495. sprintf() /home/sysanin/test.php:6 0.0015 204348 496. foo->__toString() /home/sysanin/test.php:6 0.0015 204404 497. sprintf() /home/sysanin/test.php:6 0.0015 204696 498. foo->__toString() /home/sysanin/test.php:6 0.0015 204752 499. sprintf() /home/sysanin/test.php:6