3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrays = [[0, 3, 10, 5, 6, 9, 2, 7, 1, 4, 8, 11], [0, 1, 2, 3], [0, 5, 2, 4, 3, 1], [0, 1, 3, 2]]; $deletes = [3, 5]; foreach ($arrays as $index => $array) { $filtered = array_diff($array, $deletes); foreach ($filtered as $value) { $originalValue = $value; foreach ($deletes as $delete) { $value -= $originalValue > $delete; } $result[$index][] = $value; } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 25
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 25
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 23
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 23
Branch analysis from position: 12
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 18
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 23
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/aUc9d
function name:  (null)
number of ops:  30
compiled vars:  !0 = $arrays, !1 = $deletes, !2 = $array, !3 = $index, !4 = $filtered, !5 = $value, !6 = $originalValue, !7 = $delete, !8 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2      > FE_RESET_R                                       $11     !0, ->25
          3    > > FE_FETCH_R                                       ~12     $11, !2, ->25
          4    >   ASSIGN                                                   !3, ~12
    7     5        INIT_FCALL                                               'array_diff'
          6        SEND_VAR                                                 !2
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $14     
          9        ASSIGN                                                   !4, $14
    8    10      > FE_RESET_R                                       $16     !4, ->23
         11    > > FE_FETCH_R                                               $16, !5, ->23
    9    12    >   ASSIGN                                                   !6, !5
   10    13      > FE_RESET_R                                       $18     !1, ->18
         14    > > FE_FETCH_R                                               $18, !7, ->18
   11    15    >   IS_SMALLER                                       ~19     !7, !6
         16        ASSIGN_OP                                     2          !5, ~19
   10    17      > JMP                                                      ->14
         18    >   FE_FREE                                                  $18
   13    19        FETCH_DIM_W                                      $21     !8, !3
         20        ASSIGN_DIM                                               $21
         21        OP_DATA                                                  !5
    8    22      > JMP                                                      ->11
         23    >   FE_FREE                                                  $16
    6    24      > JMP                                                      ->3
         25    >   FE_FREE                                                  $11
   17    26        INIT_FCALL                                               'var_export'
         27        SEND_VAR                                                 !8
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
131.51 ms | 1434 KiB | 15 Q