3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = ['keepThis', 'remove', false, 'keep', 'save', 'delete']; $array2 = ['hangOnto', 'remove', null, 'retain', 'keep', 'delete']; var_export([ array_filter( $array1, fn($value, $index) => $array2[$index] !== $value, ARRAY_FILTER_USE_BOTH ), array_filter( $array2, fn($value, $index) => $array1[$index] !== $value, ARRAY_FILTER_USE_BOTH ) ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fOB2r
function name:  (null)
number of ops:  22
compiled vars:  !0 = $array1, !1 = $array2
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_filter'
    8     4        SEND_VAR                                                 !0
    9     5        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          6        BIND_LEXICAL                                             ~4, !1
          7        SEND_VAL                                                 ~4
   10     8        SEND_VAL                                                 1
    7     9        DO_ICALL                                         $5      
   10    10        INIT_ARRAY                                       ~6      $5
   12    11        INIT_FCALL                                               'array_filter'
   13    12        SEND_VAR                                                 !1
   14    13        DECLARE_LAMBDA_FUNCTION                          ~7      [1]
         14        BIND_LEXICAL                                             ~7, !0
         15        SEND_VAL                                                 ~7
   15    16        SEND_VAL                                                 1
   12    17        DO_ICALL                                         $8      
   15    18        ADD_ARRAY_ELEMENT                                ~6      $8
         19        SEND_VAL                                                 ~6
    6    20        DO_ICALL                                                 
   17    21      > RETURN                                                   1


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

End of Dynamic Function 0

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

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.11 ms | 1008 KiB | 15 Q