3v4l.org

run code in 500+ PHP versions simultaneously
<?php $comps = [ [ 'c_id' => '123', 'status' => 'active' ], [ 'c_id' => '456', 'status' => 'destroyed' ], [ 'c_id' => '789', 'status' => 'active' ] ]; $rests = [ [ 'r_id' => 123, 'extra' => 'some extra info for r_id 123' ], [ 'r_id' => 456, 'extra' => 'some extra info for r_id 456' ] ]; var_export( array_uintersect( $comps, $rests, fn($a, $b) => [$a['c_id'] ?? $a['r_id'], ($a['status'] ?? 'active') === 'active'] <=> [$b['c_id'] ?? $b['r_id'], ($b['status'] ?? 'active') === 'active'] ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ngfra
function name:  (null)
number of ops:  12
compiled vars:  !0 = $comps, !1 = $rests
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   18     1        ASSIGN                                                       !1, <array>
   29     2        INIT_FCALL                                                   'var_export'
   30     3        INIT_FCALL                                                   'array_uintersect'
   31     4        SEND_VAR                                                     !0
   32     5        SEND_VAR                                                     !1
   33     6        DECLARE_LAMBDA_FUNCTION                              ~4      [0]
   37     7        SEND_VAL                                                     ~4
   30     8        DO_ICALL                                             $5      
   37     9        SEND_VAR                                                     $5
   29    10        DO_ICALL                                                     
   38    11      > 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/ngfra
function name:  {closure:/in/ngfra:33}
number of ops:  25
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   33     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   34     2        FETCH_DIM_IS                                         ~2      !0, 'c_id'
          3        COALESCE                                             ~3      ~2
          4        FETCH_DIM_R                                          ~4      !0, 'r_id'
          5        QM_ASSIGN                                            ~3      ~4
          6        INIT_ARRAY                                           ~5      ~3
          7        FETCH_DIM_IS                                         ~6      !0, 'status'
          8        COALESCE                                             ~7      ~6
          9        QM_ASSIGN                                            ~7      'active'
         10        IS_IDENTICAL                                         ~8      ~7, 'active'
         11        ADD_ARRAY_ELEMENT                                    ~5      ~8
   36    12        FETCH_DIM_IS                                         ~9      !1, 'c_id'
         13        COALESCE                                             ~10     ~9
         14        FETCH_DIM_R                                          ~11     !1, 'r_id'
         15        QM_ASSIGN                                            ~10     ~11
         16        INIT_ARRAY                                           ~12     ~10
         17        FETCH_DIM_IS                                         ~13     !1, 'status'
         18        COALESCE                                             ~14     ~13
         19        QM_ASSIGN                                            ~14     'active'
         20        IS_IDENTICAL                                         ~15     ~14, 'active'
         21        ADD_ARRAY_ELEMENT                                    ~12     ~15
         22        SPACESHIP                                            ~16     ~5, ~12
         23      > RETURN                                                       ~16
   37    24*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
149.53 ms | 1894 KiB | 15 Q