3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [ [ "id" => 1, "controller" => "users", "action" => "index" ], [ "id" => 1, "controllers" => "users", "action" => "" ], [ "id" => 1, "controller" => "users", "action" => "login" ] ]; $b = [ [ "id" => 1, "controller" => "users", "action" => "index" ], [ "id" => 1, "controllers" => "users", "action" => "" ], [ "id" => 1, "controller" => "users", "action" => "logout" ] ]; $final = array(); foreach($a AS $item) { $final[$item['controller'] . $item['action']] = $item; } foreach($b AS $item) { unset($final[$item['controller'] . $item['action']]); } $final = array_values($final); print_r($final); print_r($final);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
Branch analysis from position: 11
filename:       /in/XgCpH
function name:  (null)
number of ops:  31
compiled vars:  !0 = $a, !1 = $b, !2 = $final, !3 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   21     1        ASSIGN                                                   !1, <array>
   40     2        ASSIGN                                                   !2, <array>
   41     3      > FE_RESET_R                                       $7      !0, ->11
          4    > > FE_FETCH_R                                               $7, !3, ->11
   42     5    >   FETCH_DIM_R                                      ~8      !3, 'controller'
          6        FETCH_DIM_R                                      ~9      !3, 'action'
          7        CONCAT                                           ~10     ~8, ~9
          8        ASSIGN_DIM                                               !2, ~10
          9        OP_DATA                                                  !3
   41    10      > JMP                                                      ->4
         11    >   FE_FREE                                                  $7
   45    12      > FE_RESET_R                                       $12     !1, ->19
         13    > > FE_FETCH_R                                               $12, !3, ->19
   46    14    >   FETCH_DIM_R                                      ~13     !3, 'controller'
         15        FETCH_DIM_R                                      ~14     !3, 'action'
         16        CONCAT                                           ~15     ~13, ~14
         17        UNSET_DIM                                                !2, ~15
   45    18      > JMP                                                      ->13
         19    >   FE_FREE                                                  $12
   49    20        INIT_FCALL                                               'array_values'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                         $16     
         23        ASSIGN                                                   !2, $16
   50    24        INIT_FCALL                                               'print_r'
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                                 
   52    27        INIT_FCALL                                               'print_r'
         28        SEND_VAR                                                 !2
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.04 ms | 1396 KiB | 17 Q