3v4l.org

run code in 300+ PHP versions simultaneously
<?php $currencies = [ (object) ['name' => 'algo', 'fullName' => 'Algorand'], (object) ['name' => 'ardr', 'fullName' => 'Ardor'], (object) ['name' => 'eth', 'fullName' => 'Eth'] ]; $filter = ["eth", "algo"]; var_export( array_filter( $currencies, fn($obj) => in_array($obj->name, $filter) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BJcSX
function name:  (null)
number of ops:  18
compiled vars:  !0 = $currencies, !1 = $filter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   CAST                                          8  ~2      <array>
          1        INIT_ARRAY                                       ~3      ~2
    5     2        CAST                                          8  ~4      <array>
          3        ADD_ARRAY_ELEMENT                                ~3      ~4
    6     4        CAST                                          8  ~5      <array>
          5        ADD_ARRAY_ELEMENT                                ~3      ~5
    3     6        ASSIGN                                                   !0, ~3
    9     7        ASSIGN                                                   !1, <array>
   11     8        INIT_FCALL                                               'var_export'
   12     9        INIT_FCALL                                               'array_filter'
   13    10        SEND_VAR                                                 !0
   14    11        DECLARE_LAMBDA_FUNCTION                          ~8      [0]
         12        BIND_LEXICAL                                             ~8, !1
   15    13        SEND_VAL                                                 ~8
   12    14        DO_ICALL                                         $9      
   15    15        SEND_VAR                                                 $9
   11    16        DO_ICALL                                                 
   16    17      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BJcSX
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $obj, !1 = $filter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        INIT_FCALL                                               'in_array'
          3        FETCH_OBJ_R                                      ~2      !0, 'name'
          4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $3      
          7      > RETURN                                                   $3
   15     8*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.27 ms | 1000 KiB | 16 Q