MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001572XdebugRemote Debuggingpublic2018-08-14 19:542018-08-14 21:13
Reporterchx 
Assigned Toderick 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionnot fixable 
PlatformallOSallOS Versionall
Product Version2.6.0 
Target VersionFixed in Version 
Summary0001572: elseif is skipped
DescriptionI 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 ReproducePut an xdebug breakpoint on a line only containing elseif. It won't fire. else if does.
TagsNo tags attached.
Operating System
PHP Version7.2.0-7.2.4
Attached Files? file icon test.php [^] (68 bytes) 2018-08-14 19:54

- Relationships

-  Notes
(0004694)
derick (administrator)
2018-08-14 21:13

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 19:54 chx New Issue
2018-08-14 19:54 chx File Added: test.php
2018-08-14 21:13 derick Note Added: 0004694
2018-08-14 21:13 derick Status new => resolved
2018-08-14 21:13 derick Resolution open => not fixable
2018-08-14 21:13 derick Assigned To => derick


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker