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) { $row = array_diff($row, $arrayPost[$k] ?? []); } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 126) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/GHJl9
function name:  (null)
number of ops:  20
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_RW                                      $8      !0, ->15
          4    > > FE_FETCH_RW                                      ~9      $8, !3, ->15
          5    >   ASSIGN                                                   !4, ~9
   15     6        INIT_FCALL                                               'array_diff'
          7        SEND_VAR                                                 !3
          8        FETCH_DIM_IS                                     ~11     !1, !4
          9        COALESCE                                         ~12     ~11
         10        QM_ASSIGN                                        ~12     <array>
         11        SEND_VAL                                                 ~12
         12        DO_ICALL                                         $13     
         13        ASSIGN                                                   !3, $13
   14    14      > JMP                                                      ->4
         15    >   FE_FREE                                                  $8
   17    16        INIT_FCALL                                               'var_export'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.7 ms | 1011 KiB | 15 Q