3v4l.org

run code in 500+ 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 = 22
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 22
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 20
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 20
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 18
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 20
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/6dpQY
function name:  (null)
number of ops:  27
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, ->22
          4    > > FE_FETCH_R                                                   $8, !2, ->22
   22     5    >   FETCH_DIM_R                                          ~9      !0, 'Brand'
          6      > FE_RESET_R                                           $10     ~9, ->20
          7    > > FE_FETCH_R                                                   $10, !3, ->20
   23     8    >   FETCH_DIM_R                                          ~11     !0, 'Size'
          9      > FE_RESET_R                                           $12     ~11, ->18
         10    > > FE_FETCH_R                                                   $12, !4, ->18
   25    11    >   INIT_ARRAY                                           ~14     !2
   26    12        ADD_ARRAY_ELEMENT                                    ~14     !4
   27    13        ADD_ARRAY_ELEMENT                                    ~14     !3
   24    14        FRAMELESS_ICALL_2                implode             ~15     '+-+', ~14
         15        ASSIGN_DIM                                                   !1
   27    16        OP_DATA                                                      ~15
   23    17      > JMP                                                          ->10
         18    >   FE_FREE                                                      $12
   22    19      > JMP                                                          ->7
         20    >   FE_FREE                                                      $10
   21    21      > JMP                                                          ->4
         22    >   FE_FREE                                                      $8
   33    23        INIT_FCALL                                                   'var_dump'
         24        SEND_VAR                                                     !1
         25        DO_ICALL                                                     
         26      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.98 ms | 2193 KiB | 14 Q