3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['id' => 1, 'category' => 'Pizza', 'product' => 'Large Pizza', 'complement_type' => 'Bread', 'option' => 'Brown bread'], ['id' => 2, 'category' => 'Pizza', 'product' => 'Small Pizza', 'complement_type' => 'Bread', 'option' => 'White bread'], ['id' => 3, 'category' => 'Pizza', 'product' => 'Small Pizza', 'complement_type' => 'Ingredients', 'option' => 'Olives'], ['id' => 4, 'category' => 'Salads', 'product' => 'Green Salad', 'complement_type' => 'Extras', 'option' => 'Bacon'], ['id' => 5, 'category' => 'Salads', 'product' => 'Cesars Salad', 'complement_type' => 'Extras', 'option' => 'Lettuce'], ]; $result = []; foreach ($array as ['category' => $c, 'product' => $p, 'complement_type' => $t, 'option' => $result[$c][$p][$t]]); var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/TFvKZ
function name:  (null)
number of ops:  22
compiled vars:  !0 = $array, !1 = $result, !2 = $c, !3 = $p, !4 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, <array>
   12     2      > FE_RESET_R                                       $7      !0, ->17
          3    > > FE_FETCH_R                                               $7, $8, ->17
          4    >   FETCH_LIST_R                                     $9      $8, 'category'
          5        ASSIGN                                                   !2, $9
          6        FETCH_LIST_R                                     $11     $8, 'product'
          7        ASSIGN                                                   !3, $11
          8        FETCH_LIST_R                                     $13     $8, 'complement_type'
          9        ASSIGN                                                   !4, $13
         10        FETCH_LIST_R                                     $15     $8, 'option'
         11        FETCH_DIM_W                                      $16     !1, !2
         12        FETCH_DIM_W                                      $17     $16, !3
         13        ASSIGN_DIM                                               $17, !4
         14        OP_DATA                                                  $15
         15        FREE                                                     $8
         16      > JMP                                                      ->3
         17    >   FE_FREE                                                  $7
   13    18        INIT_FCALL                                               'var_export'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.24 ms | 1005 KiB | 14 Q