View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001542 | Xdebug | Step Debugging | public | 2018-03-27 15:44 | 2019-02-04 16:58 |
Reporter | linus | Assigned To | derick | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
Product Version | 2.6.0 | ||||
Summary | 0001542: variables created in a function body won't show up in PhpStorm | ||||
Description | When using Xdebug with PhpStorm and PHP 7.2 I cannot see the value of a variable set in a function. In contrast, if the variable is also a parameter to that function I can see it. Sorry if this was mentioned somewhere, I couldn't find anything about this. | ||||
Steps To Reproduce | create PhpStorm project (empty) and add the following as index.php ''' echo hello("World"); create a run configuration using php's built-in webserver set breakpoint on $x = 2 line open page in browser and step into have a look at the variables info | ||||
Additional Information | $ php7.2 -v $ php7.1 -v $ apt show php-xdebug | ||||
Tags | No tags attached. | ||||
Operating System | Ubuntu 16.04 | ||||
PHP Version | 7.2.0-7.2.4 | ||||
|
I might add that in addition to Ubuntu, this also doesn't work in Windows 7 (using XAMPP and PHP 7.2.3), but I am told by a colleague that it works just fine in PHP 7.2.0 (also XAMPP, but on Windows 10). |
|
This is due to OPcache optimising out the $x = 2 as it has no effect. Compare what PHP generates with OPcache enabled:
compiled vars: none line #* E I O op fetch ext return operands 2 0 E > EXT_STMT with when it is disabled (php -dvld.active=1 -dopcache.enable_cli=0 /tmp/1542.inc):
compiled vars: !0 = $name, !1 = $x line #* E I O op fetch ext return operands 2 0 E > EXT_NOP |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-03-27 15:44 | linus | New Issue | |
2018-03-28 07:38 | linus | Note Added: 0004622 | |
2019-02-04 16:58 | derick | Note Added: 0004874 | |
2019-02-04 16:58 | derick | Status | new => resolved |
2019-02-04 16:58 | derick | Resolution | open => no change required |
2019-02-04 16:58 | derick | Assigned To | => derick |
2019-02-04 16:58 | derick | Note Edited: 0004874 | |
2020-03-12 16:33 | derick | Category | Remote Debugging => Step Debugging |