View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001609 | Xdebug | Remote 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 | ||||
Target Version | Fixed in Version | ||||
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. | ||||
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? |
|
xdebug.log (114,445 bytes) |
|
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() { $a = 1; $b = $a + 1; return $b; } |
|
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 4 1 EXT_STMT 5 2 EXT_STMT 6 3 EXT_STMT 4 > RETURN 2 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 4 1 EXT_STMT 2 ASSIGN !0, 1 5 3 EXT_STMT 4 ADD 0000003:0000003 !0, 1 5 ASSIGN !1, 0000003:0000003 6 6 EXT_STMT 7 > RETURN !1 7 8* EXT_STMT 9* > RETURN null |
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 |