3v4l.org

run code in 300+ PHP versions simultaneously
<?php $q = [ [1, 2], [1, 2], [1, 2], [1, 3], [1, 3], [1, 4], ]; $tmp = []; $q = array_filter($q, function($val) use($q, &$tmp) { if (!in_array($val, $tmp)) { $tmp[] = $val; return true; } return false; }, ARRAY_FILTER_USE_BOTH); var_dump($q);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ccBbB
function name:  (null)
number of ops:  15
compiled vars:  !0 = $q, !1 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1        ASSIGN                                                   !1, <array>
   13     2        INIT_FCALL                                               'array_filter'
          3        SEND_VAR                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          5        BIND_LEXICAL                                             ~4, !0
          6        BIND_LEXICAL                                             ~4, !1
   19     7        SEND_VAL                                                 ~4
          8        SEND_VAL                                                 1
   13     9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !0, $5
   21    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
         14      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ccBbB
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $val, !1 = $q, !2 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
   14     3        INIT_FCALL                                               'in_array'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !2
          6        DO_ICALL                                         $3      
          7        BOOL_NOT                                         ~4      $3
          8      > JMPZ                                                     ~4, ->12
   15     9    >   ASSIGN_DIM                                               !2
         10        OP_DATA                                                  !0
   16    11      > RETURN                                                   <true>
   18    12    > > RETURN                                                   <false>
   19    13*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
275.09 ms | 1008 KiB | 16 Q