3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('DUMMY',"dummy"); ///// function foo($id=DUMMY){ var_dump(is_string($id)); 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/YCIiA
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                                                 
   17     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 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YCIiA
function name:  foo
number of ops:  12
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV_INIT                                        !0      <const ast>
    7     1        INIT_FCALL                                               'var_dump'
          2        TYPE_CHECK                                   64  ~1      !0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                                 
    8     5        FETCH_CONSTANT                                   ~3      'DUMMY'
          6        IS_EQUAL                                                 !0, ~3
          7      > JMPZ                                                     ~4, ->10
    9     8    >   ECHO                                                     'foo'
          9      > JMP                                                      ->11
   11    10    >   ECHO                                                     'bar'
   13    11    > > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.99 ms | 1397 KiB | 18 Q