3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f(string $str): void { if ($a = explode("-", $str)) { echo "reached if: ", var_dump($a), "\n"; } else { echo "unreached else\n"; } } f(""); f("a"); f("a-b-c");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oen7j
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'f'
          1        SEND_VAL                                                 ''
          2        DO_FCALL                                      0          
   12     3        INIT_FCALL                                               'f'
          4        SEND_VAL                                                 'a'
          5        DO_FCALL                                      0          
   13     6        INIT_FCALL                                               'f'
          7        SEND_VAL                                                 'a-b-c'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oen7j
function name:  f
number of ops:  16
compiled vars:  !0 = $str, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '-'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5        ASSIGN                                           ~3      !1, $2
          6      > JMPZ                                                     ~3, ->14
    5     7    >   ECHO                                                     'reached+if%3A+'
          8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $4      
         11        ECHO                                                     $4
         12        ECHO                                                     '%0A'
         13      > JMP                                                      ->15
    7    14    >   ECHO                                                     'unreached+else%0A'
    9    15    > > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
11.11 ms | 412 KiB | 7 Q