3v4l.org

run code in 300+ PHP versions simultaneously
<?php // the unroll: $arr = array(1 => 'one', 2 => 'two', 3 => 'three'); $a = &$arr[1]; // first iteration var_dump($a,$arr); $a = &$arr[2]; var_dump($a,$arr); $a = &$arr[3]; var_dump($a,$arr); // 2nd unroll : following up with another foreach -- $a is still a reference for $arr[3] $a = $arr[1]; $a = $arr[2]; $a = $arr[3];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y640W
function name:  (null)
number of ops:  26
compiled vars:  !0 = $arr, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        FETCH_DIM_W                                      $3      !0, 1
          2        ASSIGN_REF                                               !1, $3
    5     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
    6     7        FETCH_DIM_W                                      $6      !0, 2
          8        ASSIGN_REF                                               !1, $6
    7     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
    8    13        FETCH_DIM_W                                      $9      !0, 3
         14        ASSIGN_REF                                               !1, $9
    9    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
   12    19        FETCH_DIM_R                                      ~12     !0, 1
         20        ASSIGN                                                   !1, ~12
   13    21        FETCH_DIM_R                                      ~14     !0, 2
         22        ASSIGN                                                   !1, ~14
   14    23        FETCH_DIM_R                                      ~16     !0, 3
         24        ASSIGN                                                   !1, ~16
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.01 ms | 1395 KiB | 15 Q