3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ar1 = array('key1' => '1 value', 'key 2' => 'value 2', 'key 4' => '3'); $ar2 = array('key1' => '1 value', 'key 3' => 'value 2', 'key 4' => '4'); foreach($ar1 as $key => $value) { if(empty($ar2[$key])) { $missing_keys[] = $key; } elseif ($ar2[$key] != $value) { $non_matching_values[$key] = $value . '|<-deviation->|' . $ar2[$key]; } unset($ar2[$key]); } foreach($ar2 as $key => $value) { $missing_keys[] = $key; } print_r($missing_keys); print_r($non_matching_values);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 20
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
Branch analysis from position: 20
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 27
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
Branch analysis from position: 20
filename:       /in/JV40E
function name:  (null)
number of ops:  35
compiled vars:  !0 = $ar1, !1 = $ar2, !2 = $value, !3 = $key, !4 = $missing_keys, !5 = $non_matching_values
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    4     2      > FE_RESET_R                                       $8      !0, ->20
          3    > > FE_FETCH_R                                       ~9      $8, !2, ->20
          4    >   ASSIGN                                                   !3, ~9
    5     5        ISSET_ISEMPTY_DIM_OBJ                         1          !1, !3
          6      > JMPZ                                                     ~11, ->10
    6     7    >   ASSIGN_DIM                                               !4
          8        OP_DATA                                                  !3
    5     9      > JMP                                                      ->18
    7    10    >   FETCH_DIM_R                                      ~13     !1, !3
         11        IS_NOT_EQUAL                                             !2, ~13
         12      > JMPZ                                                     ~14, ->18
    8    13    >   CONCAT                                           ~16     !2, '%7C%3C-deviation-%3E%7C'
         14        FETCH_DIM_R                                      ~17     !1, !3
         15        CONCAT                                           ~18     ~16, ~17
         16        ASSIGN_DIM                                               !5, !3
         17        OP_DATA                                                  ~18
   10    18    >   UNSET_DIM                                                !1, !3
    4    19      > JMP                                                      ->3
         20    >   FE_FREE                                                  $8
   12    21      > FE_RESET_R                                       $19     !1, ->27
         22    > > FE_FETCH_R                                       ~20     $19, !2, ->27
         23    >   ASSIGN                                                   !3, ~20
   13    24        ASSIGN_DIM                                               !4
         25        OP_DATA                                                  !3
   12    26      > JMP                                                      ->22
         27    >   FE_FREE                                                  $19
   15    28        INIT_FCALL                                               'print_r'
         29        SEND_VAR                                                 !4
         30        DO_ICALL                                                 
   16    31        INIT_FCALL                                               'print_r'
         32        SEND_VAR                                                 !5
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.05 ms | 1015 KiB | 14 Q