View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001296 | Xdebug | Uncategorized | public | 2016-04-26 11:22 | 2017-03-04 10:45 |
Reporter | greew | Assigned To | derick | ||
Priority | high | Severity | major | Reproducibility | have not tried |
Status | resolved | Resolution | no change required | ||
Platform | Mac | OS | OS X El Capitan | OS Version | 10.11.4 (15E65) |
Product Version | 2.4.0 | ||||
Summary | 0001296: Using $this in __debugInfo() causes issues | ||||
Description | When debugging with Xdebug 2.4.0 on PHP 7.0.5, stepping into an object that has a defined debugInfo() method that refers to $this causes an uncaught LogicException; 'The object is in an invalid state as the parent constructor was not called' | ||||
Steps To Reproduce | php -dxdebug.auto_trace=1 -dxdebug.collect_params=3 -r 'class Foo extends IteratorIterator{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);' | ||||
Additional Information | 13:17 $ php -dxdebug.auto_trace=1 -dxdebug.collect_params=3 -r 'class Foo extends IteratorIterator{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);' Warning: Uncaught LogicException: The object is in an invalid state as the parent constructor was not called in Command line code:1 Call Stack: PHP Fatal error: __debuginfo() must return an array in Command line code on line 1 Fatal error: __debuginfo() must return an array in Command line code on line 1 Call Stack: ?-255 ~ | ||||
Tags | No tags attached. | ||||
Operating System | OS X | ||||
PHP Version | 7.0.0-7.0.4 | ||||
|
I am not sure how this creates "infinite recursion", but I can reproduce your |
|
No, I thoughtlessly copied the title of the issue, that I also referenced in the title - but too late I remembered to change it. |
|
Just tried reproducing it again in PHP 7.0.6 and XDebug 2.5.0-dev - still an issue. 13:43 $ php -dxdebug.auto_trace=1 -dxdebug.collect_params=3 -r 'class Foo extends IteratorIterator{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);' Warning: Uncaught LogicException: The object is in an invalid state as the parent constructor was not called in Command line code:1 Call Stack: PHP Fatal error: __debuginfo() must return an array in Command line code on line 1 Fatal error: __debuginfo() must return an array in Command line code on line 1 Call Stack: |
|
I can reproduce this issue still with PHP 7.0.13 and Xdebug 2.5.0RC2-dev. |
|
I tried this again, this time without Xdebug loaded (see the -n), and the result is exactly the same: derick@whisky:~/dev/php/derickr-xdebug $ cat tests/bug01296.phpt
} $a = new Foo( [ 1, 2, 3] ); Warning: Uncaught LogicException: The object is in an invalid state as the parent constructor was not called in /home/derick/dev/php/derickr-xdebug/tests/bug01296.phpt:17 Fatal error: __debuginfo() must return an array in /home/derick/dev/php/derickr-xdebug/tests/bug01296.phpt on line 22 So I fail to see why this is an Xdebug issue. Can you clarify please? |
|
Ping? |
|
Closing this as no additional feedback was provided, and the behaviour was the same without Xdebug loaded. |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-04-26 11:22 | greew | New Issue | |
2016-05-29 08:13 | derick | Note Added: 0003619 | |
2016-05-29 08:13 | derick | Assigned To | => derick |
2016-05-29 08:13 | derick | Status | new => acknowledged |
2016-05-29 11:41 | greew | Note Added: 0003620 | |
2016-05-29 11:44 | greew | Note Added: 0003621 | |
2016-07-31 12:36 | derick | Category | Usage problems => Usage problems (Crashes) |
2016-07-31 12:38 | derick | Category | Usage problems (Crashes) => Usage problems (Wrong Results) |
2016-12-04 15:50 | derick | Note Added: 0003908 | |
2016-12-04 15:50 | derick | Status | acknowledged => confirmed |
2017-01-14 17:38 | derick | Summary | Using $this in debugInfo() causes infinite recursion (see 0001166) => Using $this in debugInfo() causes issues |
2017-01-14 18:23 | derick | Note Added: 0004185 | |
2017-01-14 18:23 | derick | Status | confirmed => feedback |
2017-02-07 17:11 | derick | Note Added: 0004204 | |
2017-03-04 10:45 | derick | Note Added: 0004227 | |
2017-03-04 10:45 | derick | Status | feedback => resolved |
2017-03-04 10:45 | derick | Resolution | open => no change required |
2020-03-12 16:35 | derick | Category | Usage problems (Wrong Results) => Variable Display |
2020-03-12 16:38 | derick | Category | Variable Display => Uncategorized |