3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ 'Colour' => [ 'Red' => 'Red', 'Blue' => 'Blue', ], 'Size' => [ 'Small' => 'Small', 'Medium' => 'Medium', 'Large' => 'Large', ], 'Brand' => [ 'Nike' => 'Nike', 'Adidas' => 'Adidas', ], ]; $combined = []; foreach ($data['Colour'] as $colour) { foreach ($data['Brand'] as $brand) { foreach ($data['Size'] as $size) { $combined[] = implode(' - ', [ $colour, $size, $brand ]); } } } var_dump($combined);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 25
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 25
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 23
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 23
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 21
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 21
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 21
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 23
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/6dpQY
function name:  (null)
number of ops:  30
compiled vars:  !0 = $data, !1 = $combined, !2 = $colour, !3 = $brand, !4 = $size
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   19     1        ASSIGN                                                   !1, <array>
   21     2        FETCH_DIM_R                                      ~7      !0, 'Colour'
          3      > FE_RESET_R                                       $8      ~7, ->25
          4    > > FE_FETCH_R                                               $8, !2, ->25
   22     5    >   FETCH_DIM_R                                      ~9      !0, 'Brand'
          6      > FE_RESET_R                                       $10     ~9, ->23
          7    > > FE_FETCH_R                                               $10, !3, ->23
   23     8    >   FETCH_DIM_R                                      ~11     !0, 'Size'
          9      > FE_RESET_R                                       $12     ~11, ->21
         10    > > FE_FETCH_R                                               $12, !4, ->21
   24    11    >   INIT_FCALL                                               'implode'
         12        SEND_VAL                                                 '+-+'
   25    13        INIT_ARRAY                                       ~14     !2
   26    14        ADD_ARRAY_ELEMENT                                ~14     !4
   27    15        ADD_ARRAY_ELEMENT                                ~14     !3
         16        SEND_VAL                                                 ~14
   24    17        DO_ICALL                                         $15     
         18        ASSIGN_DIM                                               !1
   27    19        OP_DATA                                                  $15
   23    20      > JMP                                                      ->10
         21    >   FE_FREE                                                  $12
   22    22      > JMP                                                      ->7
         23    >   FE_FREE                                                  $10
   21    24      > JMP                                                      ->4
         25    >   FE_FREE                                                  $8
   33    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !1
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.71 ms | 1439 KiB | 15 Q