View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001609 | Xdebug | Step Debugging | public | 2019-01-15 17:21 | 2019-01-17 11:58 |
Reporter | ebreisman | Assigned To | derick | ||
Priority | high | Severity | feature | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
Platform | Apple | OS | MacOs | OS Version | 10.13.6 |
Product Version | 2.7.0beta1 | ||||
Summary | 0001609: Unable to view local variables when debugging in Phpstorm using xdebug | ||||
Description | A simple local variable assignment such as $a = 1 does not display the value of $a in the debug view. However, if $a is assigned from a call to a method such as $a = $this->myMethod(), then the value is displayed. | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Operating System | |||||
PHP Version | 7.3.0 | ||||
|
Do you have OPcache turned on? If so, it might just have optimised it out. Can you provide a short reproducible script, and a remote log (as is described at https://xdebug.org/support.php#remote) to go with it please? |
|
Short script. Both variables $a and $b did not show while stepping through the code. I still have to check whether OPcache is turned on: public function test() |
|
Just checked: OPcache is turned on. |
|
This is not a bug, but a feature in OPcache, which disables and optimises PHP code. With OPcache enabled, the following PHP opcodes are created:
compiled vars: none line #* E I O op fetch ext return operands 2 0 E > EXT_NOP As you can see, it only really does a "return 2;", and has no variables. The EXT_STMT opcodes are the ones that Xdebug can break on. With OPcache disabled, the ADD and ASSIGN statements, as well as the $a and $b variables are still there:
compiled vars: !0 = $a, !1 = $b line #* E I O op fetch ext return operands 2 0 E > EXT_NOP |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-01-15 17:21 | ebreisman | New Issue | |
2019-01-16 14:52 | derick | Note Added: 0004806 | |
2019-01-16 14:52 | derick | Assigned To | => derick |
2019-01-16 14:52 | derick | Status | new => feedback |
2019-01-16 20:08 | ebreisman | File Added: xdebug.log | |
2019-01-16 20:09 | ebreisman | Note Added: 0004810 | |
2019-01-16 20:09 | ebreisman | Status | feedback => assigned |
2019-01-16 20:21 | ebreisman | Note Added: 0004811 | |
2019-01-17 11:58 | derick | Note Added: 0004816 | |
2019-01-17 11:58 | derick | Status | assigned => resolved |
2019-01-17 11:58 | derick | Resolution | open => no change required |
2020-03-12 16:33 | derick | Category | Remote Debugging => Step Debugging |