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
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: 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-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 22:01:27 2024 UTC