|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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. :/ PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 09:00:02 2025 UTC |
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);'