3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( '0' => Array ( '0' => Array ( 'name' => 'brand', 'value' => 54, 'id' => 5251, 'price' => 15000.0000 ), '1' => Array ( 'name' => 'model', 'value' => 1200, 'id' => 5251, 'price' => 15000.0000 ) ), '1' => Array ( '0' => Array ( 'name' => 'brand', 'value' => 54, 'id' => 5250, 'price' => 15000.0000 ), '1' => Array ( 'name' => 'brand', 'value' => 1200, 'id' => 5250, 'price' => 12000.0000 ) ), '2' => Array ( '0' => Array ( 'name' => 'brand', 'value' => 89, 'id' => 518, 'price' => 100.0000 ), '1' => Array ( 'name' => 'model', 'value' => 12, 'id' => 518, 'price' => 100 ) ) ); $res = []; foreach($arr as $k => $v){ if($v[0]['name'] == $v[1]['name']) $res[$v[0]['name']] = $v[0]['id']; } echo '<hr>'; print_r($res);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/7GhUC
function name:  (null)
number of ops:  24
compiled vars:  !0 = $arr, !1 = $res, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   62     1        ASSIGN                                                   !1, <array>
   63     2      > FE_RESET_R                                       $6      !0, ->18
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->18
          4    >   ASSIGN                                                   !3, ~7
   64     5        FETCH_DIM_R                                      ~9      !2, 0
          6        FETCH_DIM_R                                      ~10     ~9, 'name'
          7        FETCH_DIM_R                                      ~11     !2, 1
          8        FETCH_DIM_R                                      ~12     ~11, 'name'
          9        IS_EQUAL                                                 ~10, ~12
         10      > JMPZ                                                     ~13, ->17
   65    11    >   FETCH_DIM_R                                      ~14     !2, 0
         12        FETCH_DIM_R                                      ~15     ~14, 'name'
         13        FETCH_DIM_R                                      ~17     !2, 0
         14        FETCH_DIM_R                                      ~18     ~17, 'id'
         15        ASSIGN_DIM                                               !1, ~15
         16        OP_DATA                                                  ~18
   63    17    > > JMP                                                      ->3
         18    >   FE_FREE                                                  $6
   67    19        ECHO                                                     '%3Chr%3E'
   68    20        INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.08 ms | 1010 KiB | 14 Q