3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(); $arr[] = array('p' => 3, 'id' => 4); $arr[] = array('p' => 3, 'id' => 5); $arr[] = array('p' => 3, 'id' => 6); $arr[] = array('p' => 2, 'id' => 3); $arr[] = array('p' => 1, 'id' => 2); $arr[] = array('p' => 1, 'id' => 7); $arr[] = 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 = 17, Position 2 = 26
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 26
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/FG9OS
function name:  (null)
number of ops:  31
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
          2        OP_DATA                                                  <array>
    4     3        ASSIGN_DIM                                               !0
          4        OP_DATA                                                  <array>
    5     5        ASSIGN_DIM                                               !0
          6        OP_DATA                                                  <array>
    6     7        ASSIGN_DIM                                               !0
          8        OP_DATA                                                  <array>
    7     9        ASSIGN_DIM                                               !0
         10        OP_DATA                                                  <array>
    8    11        ASSIGN_DIM                                               !0
         12        OP_DATA                                                  <array>
    9    13        ASSIGN_DIM                                               !0
         14        OP_DATA                                                  <array>
   11    15        ASSIGN                                                   !1, <array>
   12    16      > FE_RESET_R                                       $13     !0, ->26
         17    > > FE_FETCH_R                                       ~14     $13, !2, ->26
         18    >   ASSIGN                                                   !3, ~14
   14    19        FETCH_DIM_R                                      ~16     !2, 'p'
         20        FETCH_DIM_R                                      ~18     !2, 'id'
         21        CONCAT                                           ~20     'aaa', !3
         22        FETCH_DIM_W                                      $17     !1, ~16
         23        ASSIGN_DIM                                               $17, ~18
         24        OP_DATA                                                  ~20
   12    25      > JMP                                                      ->17
         26    >   FE_FREE                                                  $13
   17    27        INIT_FCALL                                               'print_r'
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.18 ms | 1396 KiB | 15 Q