php.net |  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
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: plankmeister at gmail dot com
New email:
PHP Version: OS:

 

 [2015-06-22 12:34 UTC] plankmeister at gmail dot com
Description:
------------
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. :/



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-22 14:08 UTC] derick@php.net
-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] derick@php.net
Please file Xdebug bugs at http://bugs.xdebug.org
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 14 09:01:26 2025 UTC