3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ref(&$a) { var_dump($a); } $b = 1; $args = [&$b]; unset($b); for ($i = 0; $i < 2; $i++) { $a = array_slice($args, 0, 1); call_user_func_array('ref', $a); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 6
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 6
Branch analysis from position: 19
Branch analysis from position: 6
filename:       /in/eR6OM
function name:  (null)
number of ops:  20
compiled vars:  !0 = $b, !1 = $args, !2 = $i, !3 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 1
    6     1        INIT_ARRAY                                       ~5      !0
          2        ASSIGN                                                   !1, ~5
    7     3        UNSET_CV                                                 !0
    8     4        ASSIGN                                                   !2, 0
          5      > JMP                                                      ->17
    9     6    >   INIT_FCALL                                               'array_slice'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 0
          9        SEND_VAL                                                 1
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !3, $8
   10    12        INIT_FCALL                                               'ref'
         13        SEND_ARRAY                                               !3
         14        CHECK_UNDEF_ARGS                                         
         15        DO_FCALL                                      0          
    8    16        PRE_INC                                                  !2
         17    >   IS_SMALLER                                               !2, 2
         18      > JMPNZ                                                    ~12, ->6
   11    19    > > RETURN                                                   1

Function ref:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eR6OM
function name:  ref
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    4     4      > RETURN                                                   null

End of function ref

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.35 ms | 1399 KiB | 18 Q