3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); $incomingArray = [ 'foo' => 'abc', 'bar' => null, 'candy' => 1, 'foobar' => true, 'barfoo' => false, ]; $myKeyCheck = ['foo', 'bar', 'candy', 'foobar', 'barfoo']; $iterator = function($a, $b) { return $a === null; }; $filter = function($a) { return $a !== null; }; \var_dump(\array_filter(\array_uintersect($incomingArray, \array_flip($myKeyCheck), $iterator), $filter));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2GLdK
function name:  (null)
number of ops:  22
compiled vars:  !0 = $incomingArray, !1 = $myKeyCheck, !2 = $iterator, !3 = $filter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   12     1        ASSIGN                                                   !1, <array>
   14     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F2GLdK%3A14%240'
          3        ASSIGN                                                   !2, ~6
   18     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F2GLdK%3A18%241'
          5        ASSIGN                                                   !3, ~8
   22     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'array_filter'
          8        INIT_FCALL                                               'array_uintersect'
          9        SEND_VAR                                                 !0
         10        INIT_FCALL                                               'array_flip'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $10     
         13        SEND_VAR                                                 $10
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $11     
         16        SEND_VAR                                                 $11
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                         $12     
         19        SEND_VAR                                                 $12
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F2GLdK%3A14%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2GLdK
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        TYPE_CHECK                                    2  ~2      !0
          3      > RETURN                                                   ~2
   16     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F2GLdK%3A14%240

Function %00%7Bclosure%7D%2Fin%2F2GLdK%3A18%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2GLdK
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        TYPE_CHECK                                  1020  ~1      !0
          2      > RETURN                                                   ~1
   20     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F2GLdK%3A18%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.41 ms | 1396 KiB | 21 Q