3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(); $arr[1] = array('p' => 3, 'id' => 4); $arr[2] = array('p' => 2, 'id' => 3); $arr[3] = array('p' => 1, 'id' => 2); $arr[4] = array('p' => 0, 'id' => 1); $mas = array(); foreach($arr as $ind => $itm) { $mas[$itm['p']][$itm['id']] = 'aaa'.$ind; } print_r($mas);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 20
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 20
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/Qdfig
function name:  (null)
number of ops:  25
compiled vars:  !0 = $arr, !1 = $mas, !2 = $itm, !3 = $ind
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN_DIM                                               !0, 1
          2        OP_DATA                                                  <array>
    4     3        ASSIGN_DIM                                               !0, 2
          4        OP_DATA                                                  <array>
    5     5        ASSIGN_DIM                                               !0, 3
          6        OP_DATA                                                  <array>
    6     7        ASSIGN_DIM                                               !0, 4
          8        OP_DATA                                                  <array>
    8     9        ASSIGN                                                   !1, <array>
    9    10      > FE_RESET_R                                       $10     !0, ->20
         11    > > FE_FETCH_R                                       ~11     $10, !2, ->20
         12    >   ASSIGN                                                   !3, ~11
   11    13        FETCH_DIM_R                                      ~13     !2, 'p'
         14        FETCH_DIM_R                                      ~15     !2, 'id'
         15        CONCAT                                           ~17     'aaa', !3
         16        FETCH_DIM_W                                      $14     !1, ~13
         17        ASSIGN_DIM                                               $14, ~15
         18        OP_DATA                                                  ~17
    9    19      > JMP                                                      ->11
         20    >   FE_FREE                                                  $10
   14    21        INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.82 ms | 1387 KiB | 15 Q