3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = json_decode('[ [ ["Monaco Chain"], ["Monaco Diamond Cut","Monaco Plain","Monaco Swarovski"], ["11.50 mm","13.50 mm","15.50 mm","17.50 mm","6.50 mm","8.00 mm","9.50 mm"], ["18.00","20.00","22.00","24.00","26.00","28.00","30.00","7.00","7.50","7.75","8.00","8.25","8.50","9.00","7.25","8.75","9.50","16.00","9.25"], ["ROSE","WHITE","YELLOW"], ["10","14","18","21"], ["New","Long"], ["No","Yes","N/A"], ["No","Yes","N/A"] ], [ ["Monaco Chain"], ["Monaco Diamond Cut","Monaco Plain"], ["6.50 mm"], ["16.00","18.00","20.00","22.00","24.00","26.00","28.00","30.00","7.50","8.00","9.00"], ["ROSE","WHITE","YELLOW"], ["10","14","18","21"], ["New"], ["No","Yes","N/A"], ["No","Yes","N/A"] ],[ ["Monaco Chain"], ["Monaco Diamond Cut","Monaco Swarovski"], ["11.50 mm","13.50 mm","15.50 mm","17.50 mm","6.50 mm","8.00 mm","9.50 mm"], ["18.00","20.00","22.00","24.00","26.00","28.00","30.00","7.00","7.50","7.75","8.00","8.25","8.50","9.00","7.25","8.75","9.50","16.00","9.25"], ["ROSE","WHITE","YELLOW"], ["10","14","18","21"], ["New","Long"], ["No"], ["No","Yes"] ] ] ', true); $subArrayCount = count($data); $subSubArrayCount = count($data[0]); $result = []; for($i=0; $i<$subSubArrayCount; ++$i) { $temp = []; for($j=0; $j<$subArrayCount; ++$j) { $temp[] = $data[$j][$i]; } $result[] = array_intersect(...$temp); } var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 13
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 16
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 13
Branch analysis from position: 32
Branch analysis from position: 13
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 16
Branch analysis from position: 23
Branch analysis from position: 16
filename:       /in/0OcbN
function name:  (null)
number of ops:  36
compiled vars:  !0 = $data, !1 = $subArrayCount, !2 = $subSubArrayCount, !3 = $result, !4 = $i, !5 = $temp, !6 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%5B%0A++++++++%5B%0A++++++++++++%5B%22Monaco+Chain%22%5D%2C%0A++++++++++++%5B%22Monaco+Diamond+Cut%22%2C%22Monaco+Plain%22%2C%22Monaco+Swarovski%22%5D%2C%0A++++++++++++%5B%2211.50+mm%22%2C%2213.50+mm%22%2C%2215.50+mm%22%2C%2217.50+mm%22%2C%226.50+mm%22%2C%228.00+mm%22%2C%229.50+mm%22%5D%2C%0A++++++++%5B%2218.00%22%2C%2220.00%22%2C%2222.00%22%2C%2224.00%22%2C%2226.00%22%2C%2228.00%22%2C%2230.00%22%2C%227.00%22%2C%227.50%22%2C%227.75%22%2C%228.00%22%2C%228.25%22%2C%228.50%22%2C%229.00%22%2C%227.25%22%2C%228.75%22%2C%229.50%22%2C%2216.00%22%2C%229.25%22%5D%2C%0A++++++++++++%5B%22ROSE%22%2C%22WHITE%22%2C%22YELLOW%22%5D%2C%0A++++++++++++%5B%2210%22%2C%2214%22%2C%2218%22%2C%2221%22%5D%2C%0A++++++++++++%5B%22New%22%2C%22Long%22%5D%2C%0A++++++++++++%5B%22No%22%2C%22Yes%22%2C%22N%2FA%22%5D%2C%0A++++++++++++%5B%22No%22%2C%22Yes%22%2C%22N%2FA%22%5D%0A++++++++%5D%2C%0A++++++++%5B%0A++++++++++++%5B%22Monaco+Chain%22%5D%2C%0A++++++++++++%5B%22Monaco+Diamond+Cut%22%2C%22Monaco+Plain%22%5D%2C%0A++++++++++++%5B%226.50+mm%22%5D%2C%0A++++++++++++%5B%2216.00%22%2C%2218.00%22%2C%2220.00%22%2C%2222.00%22%2C%2224.00%22%2C%2226.00%22%2C%2228.00%22%2C%2230.00%22%2C%227.50%22%2C%228.00%22%2C%229.00%22%5D%2C%0A++++++++++++%5B%22ROSE%22%2C%22WHITE%22%2C%22YELLOW%22%5D%2C%0A++++++++++++%5B%2210%22%2C%2214%22%2C%2218%22%2C%2221%22%5D%2C%0A++++++++++++%5B%22New%22%5D%2C%0A++++++++++++%5B%22No%22%2C%22Yes%22%2C%22N%2FA%22%5D%2C%0A++++++++++++%5B%22No%22%2C%22Yes%22%2C%22N%2FA%22%5D%0A++++++++%5D%2C%5B%0A++++++++++++%5B%22Monaco+Chain%22%5D%2C%0A++++++++++++%5B%22Monaco+Diamond+Cut%22%2C%22Monaco+Swarovski%22%5D%2C%0A++++++++++++%5B%2211.50+mm%22%2C%2213.50+mm%22%2C%2215.50+mm%22%2C%2217.50+mm%22%2C%226.50+mm%22%2C%228.00+mm%22%2C%229.50+mm%22%5D%2C%0A++++++++++++%5B%2218.00%22%2C%2220.00%22%2C%2222.00%22%2C%2224.00%22%2C%2226.00%22%2C%2228.00%22%2C%2230.00%22%2C%227.00%22%2C%227.50%22%2C%227.75%22%2C%228.00%22%2C%228.25%22%2C%228.50%22%2C%229.00%22%2C%227.25%22%2C%228.75%22%2C%229.50%22%2C%2216.00%22%2C%229.25%22%5D%2C%0A++++++++++++%5B%22ROSE%22%2C%22WHITE%22%2C%22YELLOW%22%5D%2C%0A++++++++++++%5B%2210%22%2C%2214%22%2C%2218%22%2C%2221%22%5D%2C%0A++++++++++++%5B%22New%22%2C%22Long%22%5D%2C%0A++++++++++++%5B%22No%22%5D%2C%0A++++++++++++%5B%22No%22%2C%22Yes%22%5D%0A++++++++%5D%0A++++%5D%0A++++'
   37     2        SEND_VAL                                                 <true>
    3     3        DO_ICALL                                         $7      
          4        ASSIGN                                                   !0, $7
   40     5        COUNT                                            ~9      !0
          6        ASSIGN                                                   !1, ~9
   41     7        FETCH_DIM_R                                      ~11     !0, 0
          8        COUNT                                            ~12     ~11
          9        ASSIGN                                                   !2, ~12
   42    10        ASSIGN                                                   !3, <array>
   44    11        ASSIGN                                                   !4, 0
         12      > JMP                                                      ->30
   45    13    >   ASSIGN                                                   !5, <array>
   46    14        ASSIGN                                                   !6, 0
         15      > JMP                                                      ->21
   47    16    >   FETCH_DIM_R                                      ~19     !0, !6
         17        FETCH_DIM_R                                      ~20     ~19, !4
         18        ASSIGN_DIM                                               !5
         19        OP_DATA                                                  ~20
   46    20        PRE_INC                                                  !6
         21    >   IS_SMALLER                                               !6, !1
         22      > JMPNZ                                                    ~22, ->16
   49    23    >   INIT_FCALL                                               'array_intersect'
         24        SEND_UNPACK                                              !5
         25        CHECK_UNDEF_ARGS                                         
         26        DO_ICALL                                         $24     
         27        ASSIGN_DIM                                               !3
         28        OP_DATA                                                  $24
   44    29        PRE_INC                                                  !4
         30    >   IS_SMALLER                                               !4, !2
         31      > JMPNZ                                                    ~26, ->13
   51    32    >   INIT_FCALL                                               'var_dump'
         33        SEND_VAR                                                 !3
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
125.94 ms | 1017 KiB | 16 Q