php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67491 Crush __debugInfo
Submitted: 2014-06-21 17:50 UTC Modified: 2014-06-21 18:33 UTC
From: imbolk at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.6.0RC1 OS: Mac OS X 10.9.3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: imbolk at gmail dot com
New email:
PHP Version: OS:

 

 [2014-06-21 17:50 UTC] imbolk at gmail dot com
Description:
------------
Crush in __debugInfo then $GLOBALS returned.

Test script:
---------------
class A
{
    public function __debugInfo()
    {
        return $GLOBALS;
    }
}

$a = new A;
var_dump($a);

Expected result:
----------------
$GLOBALS output.

Actual result:
--------------
core dumped

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-06-21 18:20 UTC] johannes@php.net
-Status: Open +Status: Not a bug
 [2014-06-21 18:20 UTC] johannes@php.net
This is a "normal" stackoverflow due to infinite recursion - $GLOBALS includes $a so $a's debugInfo is called over and over again.
 [2014-06-21 18:33 UTC] imbolk at gmail dot com
Try to execute var_dump($GLOBALS); See how it crash? No?
 [2014-06-24 02:40 UTC] anon at anon dot anon
johannes, var_dump correctly detects recursion in every other case. I don't see why it shouldn't be able to when __debugInfo is used too.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 12:00:02 2026 UTC