View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001166 | Xdebug | Uncategorized | public | 2015-06-22 21:13 | 2015-11-05 15:13 |
| Reporter | plankmeister | Assigned To | |||
| Priority | high | Severity | major | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Fixed in Version | 2.4.0beta1 | ||||
| Summary | 0001166: Using $this in __debugInfo() causes infinite recursion (Doesn't appear to be the same as issue 0001140) | ||||
| Description | When debugging with Xdebug 2.3.3 on PHP 5.6.9, 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 | Output extract: PHP Stack trace: | ||||
| Tags | No tags attached. | ||||
| Operating System | Debian GNU/Linux 7.8 (wheezy) | ||||
| PHP Version | 5.5.15-5.5.19 | ||||
|
|
The actual Class in production code that produces the issue is https://github.com/cakephp/cakephp/blob/3.1/src/Collection/Collection.php if the context is important. |
|
|
Thanks - I can reproduce this with your reproduce script. Thanks for making it so short! I'll have a look. |
|
|
Fixed for 2.3.4 and 3.0dev |