3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $code = 'fr_fr'; var_dump(false === ($pos = strpos($code, '_')) ? $code : substr($code, 0, $pos)); $code = 'fr'; var_dump(false === ($pos = strpos($code, '_')) ? $code : substr($code, 0, $pos)); $code = '_fr'; var_dump(false === ($pos = strpos($code, '_')) ? $code : substr($code, 0, $pos));
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
Jump found. Position 1 = 17
Branch analysis from position: 17
Jump found. Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
Jump found. Position 1 = 36
Branch analysis from position: 36
Jump found. Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
Jump found. Position 1 = 55
Branch analysis from position: 55
Jump found. Position 1 = -2
Branch analysis from position: 49
Jump found. Position 1 = -2
Branch analysis from position: 30
Jump found. Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
Branch analysis from position: 49
Branch analysis from position: 11
Jump found. Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
Branch analysis from position: 30
filename:       /in/oQsoV
function name:  (null)
number of ops:  58
compiled vars:  !0 = $code, !1 = $pos
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   ASSIGN                                                   !0, 'fr_fr'
   3     1        INIT_FCALL                                               'var_dump'
         2        INIT_FCALL                                               'strpos'
         3        SEND_VAR                                                 !0
         4        SEND_VAL                                                 '_'
         5        DO_ICALL                                         $3      
         6        ASSIGN                                           $4      !1, $3
         7        IS_IDENTICAL                                     ~5      <false>, $4
         8      > JMPZ                                                     ~5, ->11
         9    >   QM_ASSIGN                                        ~6      !0
        10      > JMP                                                      ->17
        11    >   INIT_FCALL                                               'substr'
        12        SEND_VAR                                                 !0
        13        SEND_VAL                                                 0
        14        SEND_VAR                                                 !1
        15        DO_ICALL                                         $7      
        16        QM_ASSIGN                                        ~6      $7
        17    >   SEND_VAL                                                 ~6
        18        DO_ICALL                                                 
   4    19        ASSIGN                                                   !0, 'fr'
   5    20        INIT_FCALL                                               'var_dump'
        21        INIT_FCALL                                               'strpos'
        22        SEND_VAR                                                 !0
        23        SEND_VAL                                                 '_'
        24        DO_ICALL                                         $10     
        25        ASSIGN                                           $11     !1, $10
        26        IS_IDENTICAL                                     ~12     <false>, $11
        27      > JMPZ                                                     ~12, ->30
        28    >   QM_ASSIGN                                        ~13     !0
        29      > JMP                                                      ->36
        30    >   INIT_FCALL                                               'substr'
        31        SEND_VAR                                                 !0
        32        SEND_VAL                                                 0
        33        SEND_VAR                                                 !1
        34        DO_ICALL                                         $14     
        35        QM_ASSIGN                                        ~13     $14
        36    >   SEND_VAL                                                 ~13
        37        DO_ICALL                                                 
   6    38        ASSIGN                                                   !0, '_fr'
   7    39        INIT_FCALL                                               'var_dump'
        40        INIT_FCALL                                               'strpos'
        41        SEND_VAR                                                 !0
        42        SEND_VAL                                                 '_'
        43        DO_ICALL                                         $17     
        44        ASSIGN                                           $18     !1, $17
        45        IS_IDENTICAL                                     ~19     <false>, $18
        46      > JMPZ                                                     ~19, ->49
        47    >   QM_ASSIGN                                        ~20     !0
        48      > JMP                                                      ->55
        49    >   INIT_FCALL                                               'substr'
        50        SEND_VAR                                                 !0
        51        SEND_VAL                                                 0
        52        SEND_VAR                                                 !1
        53        DO_ICALL                                         $21     
        54        QM_ASSIGN                                        ~20     $21
        55    >   SEND_VAL                                                 ~20
        56        DO_ICALL                                                 
        57      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0