3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('DUMMY',"dummy"); ///// function foo($id=DUMMY){ if($id == DUMMY){ echo "foo"; } else { echo "bar"; } } ///// foo(0);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vP0ta
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'DUMMY'
          2        SEND_VAL                                                 'dummy'
          3        DO_ICALL                                                 
   16     4        INIT_FCALL                                               'foo'
          5        SEND_VAL                                                 0
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vP0ta
function name:  foo
number of ops:  8
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV_INIT                                        !0      <const ast>
    7     1        FETCH_CONSTANT                                   ~1      'DUMMY'
          2        IS_EQUAL                                                 !0, ~1
          3      > JMPZ                                                     ~2, ->6
    8     4    >   ECHO                                                     'foo'
          5      > JMP                                                      ->7
   10     6    >   ECHO                                                     'bar'
   12     7    > > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.86 ms | 942 KiB | 17 Q