View Issue Details

IDProjectCategoryView StatusLast Update
0001572XdebugStep Debuggingpublic2018-08-14 20:13
Reporterchx Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionnot fixable 
PlatformallOSallOS Versionall
Product Version2.6.0 
Summary0001572: elseif is skipped
Description

I filed here https://youtrack.jetbrains.com/issue/WI-43191 but it seems like an xdebug problem. I tested with 2.4.0 , Andriy Bazanov reproduced with 2.6.0.

Steps To Reproduce

Put an xdebug breakpoint on a line only containing elseif. It won't fire. else if does.

TagsNo tags attached.
Attached Files
test.php (68 bytes)
Operating System
PHP Version7.2.0-7.2.4

Activities

derick

2018-08-14 20:13

administrator   ~0004694

Do you have Zend OPcache enabled? Because with it, it is smart, and removes the whole if part of it. See what VLD says with OPCache on:


line #* E I O op fetch ext return operands

3 0 E > EXT_STMT
6 1 EXT_STMT
2 ECHO 1
9 3 > RETURN 1

It doesn't generate anything on line 5 (where the elseif is at).

Even without OPcache, you're going to be out of luck, as PHP doesn't generate an EXT_STMT for "elseif" (only a JMPZ on line 5):


line #* E I O op fetch ext return operands

3 0 E > EXT_STMT
1 > JMPZ <false>, ->3
2 > > JMP ->6
5 3 > > JMPZ <true>, ->6
6 4 > EXT_STMT
5 ECHO 1
9 6 > > RETURN 1

although it does for "else if":


line #* E I O op fetch ext return operands

3 0 E > EXT_STMT
1 > JMPZ <false>, ->3
2 > > JMP ->7
5 3 > EXT_STMT
4 > JMPZ <true>, ->7
6 5 > EXT_STMT
6 ECHO 1
9 7 > > RETURN 1

I'm afraid there is nothing I can do here, and I would recommend you file a bug with the PHP team at https://bugs.php.net in order for them to fix that.

Issue History

Date Modified Username Field Change
2018-08-14 18:54 chx New Issue
2018-08-14 18:54 chx File Added: test.php
2018-08-14 20:13 derick Note Added: 0004694
2018-08-14 20:13 derick Status new => resolved
2018-08-14 20:13 derick Resolution open => not fixable
2018-08-14 20:13 derick Assigned To => derick
2020-03-12 16:33 derick Category Remote Debugging => Step Debugging