View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001181 | Xdebug | public | 2015-08-25 17:47 | 2015-12-07 11:32 | |
Reporter | Blizz | Assigned To | derick | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Mac | OS | MacOS | OS Version | 10.10.4 |
Product Version | 2.3.3 | ||||
Target Version | 2.4.1 | Fixed in Version | 2.4.0rc2 | ||
Summary | 0001181: Derived class with __get gets called on fetching base class private property | ||||
Description | Yii2's __get() implementation throws an exception when __get is called with a non-existing $name. It seems that XDebug calls the __get function to obtain the value for a private variable of the base class and the resulting exception is not caught. Possibly related: Clicking open a Closure also results in an similar exception ("Closue object cannot have properties"). Please let me know if you would like an extra ticket for that. Code example (no dependencies): <?php class BaseClass { protected $protected = [1, 2, 3]; private $private = ['a', 'b', 'c']; } class DerivedClass extends BaseClass { function __get($name) { throw new \Exception('Derived class getter called with: ' . $name); } } try { $test = new DerivedClass(); echo "Statement to break on."; // Breakpoint here } catch (\Exception $e) { echo $e->getMessage(); } | ||||
Steps To Reproduce | Set the breakpoint, start the session and when the breakpoint hits, open up the $test variable. In the test variable, click open *BaseClass*private. After this, do a step over. It will jump into the catch handler. | ||||
Additional Information | Reported in https://youtrack.jetbrains.com/issue/WI-28237 and per your instructions duplicated here. A screencast of the behavior can be found there as well. Jetbrains reports that it is not reproducible in 2.3.2 but it is in 2.3.3, haven't tried to confirm this. Direct links: Screencast: https://youtrack.jetbrains.com/_persistent/Exception.mov?file=74-250258&v=0&c=true Source file: https://youtrack.jetbrains.com/_persistent/test.php?file=74-250259&v=0&c=true | ||||
Tags | No tags attached. | ||||
Operating System | Centos 7.1 | ||||
PHP Version | 5.6.0-5.6.4 | ||||
|
|
|
test.php (391 bytes)
<?php class BaseClass { protected $protected = [1, 2, 3]; private $private = ['a', 'b', 'c']; } class DerivedClass extends BaseClass { function __get($name) { throw new \Exception('Derived class getter called with: ' . $name); } } try { $test = new DerivedClass(); echo "Statement to break on."; } catch (\Exception $e) { echo $e->getMessage(); } |
|
Fixed in 2.4.0. Thanks for the report! I would indeed like a separate issue for the closure issue - unless that got fixed with this bug fix of course. |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-08-25 17:47 | Blizz | New Issue | |
2015-08-25 17:47 | Blizz | File Added: xdebug.log | |
2015-08-25 18:01 | Blizz | File Added: test.php | |
2015-11-20 17:59 | derick | Target Version | => 2.4.1 |
2015-11-22 15:39 | derick | Note Added: 0003256 | |
2015-11-22 15:39 | derick | Status | new => closed |
2015-11-22 15:39 | derick | Assigned To | => derick |
2015-11-22 15:39 | derick | Resolution | open => fixed |
2015-11-22 15:39 | derick | Fixed in Version | => 2.4.0 |
2015-12-07 11:32 | derick | Fixed in Version | 2.4.0 => 2.4.0rc2 |
2016-07-31 12:35 | derick | Category | Debug client (console) => debugclient (debugging tool) |
2016-07-31 12:35 | derick | Category | debugclient (debugging tool) => (No Category) |