3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arraySession = [ 'sampleA' => ['1', '2', '3'], 'sampleB' => ['1', '2', '3'], ]; $arrayPost = [ 'sampleA' => ['1'], 'sampleB' => ['1','2'], ]; $result = []; foreach ($arraySession as $k => $row) { $result[$k] = array_diff($row, $arrayPost[$k] ?? []); } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/POmtf
function name:  (null)
number of ops:  21
compiled vars:  !0 = $arraySession, !1 = $arrayPost, !2 = $result, !3 = $row, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, <array>
   13     2        ASSIGN                                                   !2, <array>
   14     3      > FE_RESET_R                                       $8      !0, ->16
          4    > > FE_FETCH_R                                       ~9      $8, !3, ->16
          5    >   ASSIGN                                                   !4, ~9
   15     6        INIT_FCALL                                               'array_diff'
          7        SEND_VAR                                                 !3
          8        FETCH_DIM_IS                                     ~12     !1, !4
          9        COALESCE                                         ~13     ~12
         10        QM_ASSIGN                                        ~13     <array>
         11        SEND_VAL                                                 ~13
         12        DO_ICALL                                         $14     
         13        ASSIGN_DIM                                               !2, !4
         14        OP_DATA                                                  $14
   14    15      > JMP                                                      ->4
         16    >   FE_FREE                                                  $8
   17    17        INIT_FCALL                                               'var_export'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.71 ms | 1005 KiB | 15 Q