3v4l.org

run code in 500+ 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]; var_export( array_map( function($array) use ($deletes) { $result = []; foreach (array_diff($array, $deletes) as $value) { $result[] = array_reduce( $deletes, function ($carry, $item) use ($value) { return $carry - ($value > $item); }, $value ); } return $result; }, $arrays ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EmKUO
function name:  (null)
number of ops:  12
compiled vars:  !0 = $arrays, !1 = $deletes
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, <array>
    6     2        INIT_FCALL                                                   'var_export'
    7     3        INIT_FCALL                                                   'array_map'
    8     4        DECLARE_LAMBDA_FUNCTION                              ~4      [0]
          5        BIND_LEXICAL                                                 ~4, !1
   20     6        SEND_VAL                                                     ~4
   21     7        SEND_VAR                                                     !0
    7     8        DO_ICALL                                             $5      
   21     9        SEND_VAR                                                     $5
    6    10        DO_ICALL                                                     
   23    11      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 19
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/EmKUO
function name:  {closure:/in/EmKUO:8}
number of ops:  22
compiled vars:  !0 = $array, !1 = $deletes, !2 = $result, !3 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
    9     2        ASSIGN                                                       !2, <array>
   10     3        INIT_FCALL                                                   'array_diff'
          4        SEND_VAR                                                     !0
          5        SEND_VAR                                                     !1
          6        DO_ICALL                                             $5      
          7      > FE_RESET_R                                           $6      $5, ->19
          8    > > FE_FETCH_R                                                   $6, !3, ->19
   11     9    >   INIT_FCALL                                                   'array_reduce'
   12    10        SEND_VAR                                                     !1
   13    11        DECLARE_LAMBDA_FUNCTION                              ~8      [0]
         12        BIND_LEXICAL                                                 ~8, !3
   15    13        SEND_VAL                                                     ~8
   16    14        SEND_VAR                                                     !3
   11    15        DO_ICALL                                             $9      
         16        ASSIGN_DIM                                                   !2
   16    17        OP_DATA                                                      $9
   10    18      > JMP                                                          ->8
         19    >   FE_FREE                                                      $6
   19    20      > RETURN                                                       !2
   20    21*     > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EmKUO
function name:  {closure:{closure:/in/EmKUO:8}:13}
number of ops:  7
compiled vars:  !0 = $carry, !1 = $item, !2 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        BIND_STATIC                                                  !2
   14     3        IS_SMALLER                                           ~3      !1, !2
          4        SUB                                                  ~4      !0, ~3
          5      > RETURN                                                       ~4
   15     6*     > RETURN                                                       null

End of Dynamic Function 0

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
169.13 ms | 2218 KiB | 17 Q