MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001181Xdebug(No Category)public2015-08-25 18:472015-12-07 11:32
ReporterBlizz 
Assigned Toderick 
PrioritynormalSeveritycrashReproducibilityalways
StatusclosedResolutionfixed 
PlatformMacOSMacOSOS Version10.10.4
Product Version2.3.3 
Target Version2.4.1Fixed in Version2.4.0rc2 
Summary0001181: Derived class with __get gets called on fetching base class private property
DescriptionYii2'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 ReproduceSet 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 InformationReported 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 [^]
TagsNo tags attached.
Operating SystemCentos 7.1
PHP Version5.6.0-5.6.4
Attached Fileslog file icon xdebug.log [^] (35,204 bytes) 2015-08-25 18:47
? file icon test.php [^] (391 bytes) 2015-08-25 19:01

- Relationships

-  Notes
(0003256)
derick (administrator)
2015-11-22 15:39

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.

- Issue History
Date Modified Username Field Change
2015-08-25 18:47 Blizz New Issue
2015-08-25 18:47 Blizz File Added: xdebug.log
2015-08-25 19: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 13:35 derick Category Debug client (console) => debugclient (debugging tool)
2016-07-31 13:35 derick Category debugclient (debugging tool) => (No Category)


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker