3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [ 0 => 'AXA', 1 => 'VHV', 2 => 'TEST', ]; $doctypes = [ 12 => 'AXA', 156 => 'VHV', 8 => 'TEST', ]; $tops = array_filter( $a, function (string $name, int $key) use ($doctypes) { return in_array($name, $doctypes); }, ARRAY_FILTER_USE_BOTH ); var_dump($tops); exit;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/dnQD5
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a, !1 = $doctypes, !2 = $tops
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   15     2        INIT_FCALL                                               'array_filter'
   16     3        SEND_VAR                                                 !0
   17     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FdnQD5%3A17%240'
          5        BIND_LEXICAL                                             ~5, !1
   19     6        SEND_VAL                                                 ~5
   20     7        SEND_VAL                                                 1
          8        DO_ICALL                                         $6      
   15     9        ASSIGN                                                   !2, $6
   23    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                                 
   24    13      > EXIT                                                     
   25    14*     > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FdnQD5%3A17%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.42 ms | 1395 KiB | 19 Q