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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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 05:00:01 2026 UTC