#46754 [Opn->Bgs]: Infinite recursion in __toString method causes crash
| From: | derick@php.net | Date: | Fri, 05 Dec 2008 09:31:33 +0000 |
| Subject: | #46754 [Opn->Bgs]: Infinite recursion in __toString method causes crash | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-131615@lists.php.net to get a copy of this message | ||
ID: 46754
Updated by: derick@php.net
Reported By: kalle@php.net
-Status: Open
+Status: Bogus
Bug Type: Reproducible crash
Operating System: *
PHP Version: 5.2.6
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
Infinite recursion crashes, and always has. This should work in PHP 5.3
though, as we don't generally use stack for recursion anymore.
Previous Comments:
------------------------------------------------------------------------
[2008-12-05 02:52:59] kalle@php.net
Description:
------------
Same type of crash as reported in #46156, instead of a crash a
memory_limit error is expected.
Reproduce code:
---------------
<?php
class Crash
{
public function __toString()
{
return((string) new self);
}
}
echo new Crash;
?>
Expected result:
----------------
memory_limit error
Actual result:
--------------
Crash
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46754&edit=1