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_uintersect( $currencies, $filter, fn($a, $b) => ($a->name ?? $a) <=> ($b->name ?? $b) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AjIrN
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_uintersect'
   13    10        SEND_VAR                                                 !0
   14    11        SEND_VAR                                                 !1
   15    12        DECLARE_LAMBDA_FUNCTION                          ~8      [0]
   19    13        SEND_VAL                                                 ~8
   12    14        DO_ICALL                                         $9      
   19    15        SEND_VAR                                                 $9
   11    16        DO_ICALL                                                 
   20    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/AjIrN
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        FETCH_OBJ_IS                                     ~2      !0, 'name'
          3        COALESCE                                         ~3      ~2
          4        QM_ASSIGN                                        ~3      !0
   18     5        FETCH_OBJ_IS                                     ~4      !1, 'name'
          6        COALESCE                                         ~5      ~4
          7        QM_ASSIGN                                        ~5      !1
          8        SPACESHIP                                        ~6      ~3, ~5
          9      > RETURN                                                   ~6
   19    10*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.95 ms | 1000 KiB | 15 Q