View Issue Details

IDProjectCategoryView StatusLast Update
0001966XdebugStacktracespublic2021-04-21 08:20
Reporternask0 Assigned Toderick  
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionno change required 
Product Version3.0.3 
Summary0001966: Xdebug doesn't respect __debugInfo() method
Description

Xdebug still doesn't respect __debugInfo(). Here is example:

class Foo {
    public $bar = 55;

    public function __debugInfo()
    {
        return [ 'foo' => 42];
    }
}

$f = new Foo();
var_dump($f);
exit;

Expected result:

class Foo#1 (1) {
  public $bar =>
  int(42)
}

Actual result:

class Foo#1 (1) {
  public $bar =>
  int(55)
}

PHP Version:

PHP 7.4.16 (cli) (built: Mar  2 2021 10:35:17) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.16, Copyright (c), by Zend Technologies
    with Xdebug v3.0.3, Copyright (c) 2002-2021, by Derick Rethans
TagsNo tags attached.
Operating System
PHP Version7.4.10-7.4.19

Relationships

duplicate of 0001662 closedderick __debugInfo should not be used for user-defined classes 

Activities

derick

2021-04-21 08:20

administrator   ~0005854

This is by design. See also https://bugs.xdebug.org/1662

Issue History

Date Modified Username Field Change
2021-04-17 09:34 nask0 New Issue
2021-04-21 08:20 derick Assigned To => derick
2021-04-21 08:20 derick Status new => closed
2021-04-21 08:20 derick Resolution open => no change required
2021-04-21 08:20 derick Note Added: 0005854
2021-04-21 08:20 derick Relationship added duplicate of 0001662