3v4l.org

run code in 300+ PHP versions simultaneously
v<?php $items = array(array(1 => 1), array(2 => 2), array(1 => 1)); $items = array_filter($items, function($item) {static $seen; $serial = serialize($item); $retVal = !isset($seen[$serial]); $seen[$serial] = TRUE; return $retVal;}); var_dump($items);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cAoV9
function name:  (null)
number of ops:  12
compiled vars:  !0 = $items
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     'v'
    2     1        ASSIGN                                                   !0, <array>
    3     2        INIT_FCALL                                               'array_filter'
          3        SEND_VAR                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcAoV9%3A3%240'
    5     5        SEND_VAL                                                 ~2
          6        DO_ICALL                                         $3      
    3     7        ASSIGN                                                   !0, $3
    6     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FcAoV9%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cAoV9
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $item, !1 = $seen, !2 = $serial, !3 = $retVal
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    4     2        INIT_FCALL                                               'serialize'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !2, $4
          6        ISSET_ISEMPTY_DIM_OBJ                         0  ~6      !1, !2
          7        BOOL_NOT                                         ~7      ~6
          8        ASSIGN                                                   !3, ~7
    5     9        ASSIGN_DIM                                               !1, !2
         10        OP_DATA                                                  <true>
         11      > RETURN                                                   !3
         12*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FcAoV9%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.45 ms | 1395 KiB | 19 Q