From: [email protected]
Operating system: *
PHP version: 5.3SVN-2009-08-07 (SVN)
PHP Bug Type: Variables related
Bug description: var_dump() doesn't completely protect against infinite looping
Description:
------------
Calling var_dump() on a closure that references itself results in an
infinite loop.
Reproduce code:
---------------
<?php
$f = function () use (&$f) {};
var_dump($f);
?>
Expected result:
----------------
object(Closure)#1 (1) {
["static"]=>
array(1) {
["f"]=>
&object(Closure)#1 (1) {
["static"]=>
array(1) {
["f"]=>RECURSION
}
}
}
}
Actual result:
--------------
object(Closure)#1 (1) {
["static"]=>
array(1) {
["f"]=>
&object(Closure)#1 (1) {
["static"]=>
array(1) {
["f"]=>
&object(Closure)#1 (1) {
["static"]=>
array(1) {
["f"]=>
<repeats forever>
--
Edit bug report at http://bugs.php.net/?id=49194&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=49194&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=49194&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=49194&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=49194&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=49194&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=49194&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=49194&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=49194&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=49194&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=49194&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=49194&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=49194&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=49194&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=49194&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49194&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49194&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=49194&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=49194&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=49194&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=49194&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=49194&r=mysqlcfg