3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array('red', 'white', 'blue'); $new_array = array(); $temp_array = &$new_array; foreach ($array as $item) { $temp_array = &$temp_array['and']; // $temp_array now equals null, // and it's references to parent array item with key and $temp_array['like'] = $item; } unset($temp_array); print_r($new_array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/WtLPK
function name:  (null)
number of ops:  16
compiled vars:  !0 = $array, !1 = $new_array, !2 = $temp_array, !3 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN_REF                                               !2, !1
    7     3      > FE_RESET_R                                       $7      !0, ->10
          4    > > FE_FETCH_R                                               $7, !3, ->10
    9     5    >   FETCH_DIM_W                                      $8      !2, 'and'
          6        ASSIGN_REF                                               !2, $8
   12     7        ASSIGN_DIM                                               !2, 'like'
          8        OP_DATA                                                  !3
    7     9      > JMP                                                      ->4
         10    >   FE_FREE                                                  $7
   14    11        UNSET_CV                                                 !2
   15    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.43 ms | 1395 KiB | 15 Q