3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array("test"=>"1", "test2"=>2, "test3"=>3); $needed = array("test", "test2"); $a = array_filter($a, function ($item, $needed) { return in_array($item, $needed); });
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FnVQX
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a, !1 = $needed
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'array_filter'
          3        SEND_VAR                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FFnVQX%3A6%240'
    8     5        SEND_VAL                                                 ~4
          6        DO_ICALL                                         $5      
    6     7        ASSIGN                                                   !0, $5
    8     8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FFnVQX%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FnVQX
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $item, !1 = $needed
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        INIT_FCALL                                               'in_array'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
    8     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FFnVQX%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.38 ms | 1395 KiB | 17 Q