|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69898 __debugInfo() / Xdebug incompatibility
Submitted: 2015-06-22 12:34 UTC Modified: 2015-06-22 17:07 UTC
From: plankmeister at gmail dot com Assigned: derick (profile)
Status: Closed Package: Xdebug
PHP Version: 5.6.10 OS: Debian GNU/Linux 7.8 (wheezy)
Private report: No CVE-ID: None
 [2015-06-22 12:34 UTC] plankmeister at gmail dot com
The new __debugInfo() is causing issues when used in conjunction with Xdebug. When debugging, stepping into a Class that has a defined __debugInfo() method immediately invokes that method (I'm guessing it's some kind of interception performed by Xdebug) 
If statements in the __debugInfo() method attempt to access $this, the code dies immediately, complaining that the object is not properly initialised. I've only confirmed this bug if the __debugInfo() method that triggers the error is in a subclass. 
This effectively makes it impossible to debug using Xdebug. 
Would it be possible to have an INI setting that would disable the __debugInfo feature? So that setting something like disable_debuginfo=1 would then cause PHP to ignore the __debugInfo method? 
I would contribute this fix myself, but I have zero experience of C. :/


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-22 14:08 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: derick
 [2015-06-22 16:40 UTC] plankmeister at gmail dot com
I can recreate the issue in 2.3.3 with this code:

php -dxdebug.auto_trace=1 -dxdebug.collect_params=3 -r 'class Foo {function __construct($items){if(is_array($items)){$items=new ArrayIterator($items);}}function __debugInfo(){return ['count'=>iterator_count($this)];}};$a=new Foo([1,2,3]);var_dump($a);'
 [2015-06-22 17:07 UTC]
Please file Xdebug bugs at
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Dec 05 03:03:36 2021 UTC