3v4l.org

run code in 300+ PHP versions simultaneously
<?php function check($value) { if ($value != "") { echo 'is not an empty string'; } else if ($value == '') { echo 'is an empty string'; } else { echo 'something else'; } } foreach(array( '', 0, false, true, null, -1, array(), 1, '0', '1' ) as $value) { var_export($value); echo check($value), "\n\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 1, Position 2 = 11
Branch analysis from position: 1
2 jumps found. (Code = 78) Position 1 = 2, Position 2 = 11
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 1
Branch analysis from position: 1
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/SEk5h
function name:  (null)
number of ops:  13
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E > > FE_RESET_R                                       $1      <array>, ->11
          1    > > FE_FETCH_R                                               $1, !0, ->11
   23     2    >   INIT_FCALL                                               'var_export'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   24     5        INIT_FCALL                                               'check'
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0  $3      
          8        ECHO                                                     $3
          9        ECHO                                                     '%0A%0A'
   12    10      > JMP                                                      ->1
         11    >   FE_FREE                                                  $1
   25    12      > RETURN                                                   1

Function check:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SEk5h
function name:  check
number of ops:  11
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        IS_NOT_EQUAL                                             !0, ''
          2      > JMPZ                                                     ~1, ->5
    4     3    >   ECHO                                                     'is+not+an+empty+string'
          4      > JMP                                                      ->10
    5     5    >   IS_EQUAL                                                 !0, ''
          6      > JMPZ                                                     ~2, ->9
    6     7    >   ECHO                                                     'is+an+empty+string'
          8      > JMP                                                      ->10
    8     9    >   ECHO                                                     'something+else'
   10    10    > > RETURN                                                   null

End of function check

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.39 ms | 1390 KiB | 16 Q