3v4l.org

run code in 300+ PHP versions simultaneously
<?php function do_ref(&$ref) { foreach ($ref as $index => $value) { unset($ref[$index]); } } $array = ['foo' => [1 => 'bar']]; do_ref($array); print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OjYHI
function name:  (null)
number of ops:  8
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, <array>
   12     1        INIT_FCALL                                               'do_ref'
          2        SEND_REF                                                 !0
          3        DO_FCALL                                      0          
   14     4        INIT_FCALL                                               'print_r'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function do_ref:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 6
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/OjYHI
function name:  do_ref
number of ops:  8
compiled vars:  !0 = $ref, !1 = $value, !2 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1      > FE_RESET_R                                       $3      !0, ->6
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->6
          3    >   ASSIGN                                                   !2, ~4
    6     4        UNSET_DIM                                                !0, !2
    5     5      > JMP                                                      ->2
          6    >   FE_FREE                                                  $3
    8     7      > RETURN                                                   null

End of function do_ref

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.72 ms | 1397 KiB | 16 Q