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( array_filter($comps, function($row) { return $row['status'] === 'active'; }), $rests, function($a, $b) { return ($a['c_id'] ?? $a['r_id']) <=> ($b['c_id'] ?? $b['r_id']); } ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3H9rr
function name:  (null)
number of ops:  17
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        INIT_FCALL                                                   'array_filter'
          5        SEND_VAR                                                     !0
          6        DECLARE_LAMBDA_FUNCTION                              ~4      [0]
          7        SEND_VAL                                                     ~4
          8        DO_ICALL                                             $5      
          9        SEND_VAR                                                     $5
   32    10        SEND_VAR                                                     !1
   33    11        DECLARE_LAMBDA_FUNCTION                              ~6      [1]
   37    12        SEND_VAL                                                     ~6
   30    13        DO_ICALL                                             $7      
   37    14        SEND_VAR                                                     $7
   29    15        DO_ICALL                                                     
   39    16      > 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/3H9rr
function name:  {closure:/in/3H9rr:31}
number of ops:  5
compiled vars:  !0 = $row
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   31     0  E >   RECV                                                 !0      
          1        FETCH_DIM_R                                          ~1      !0, 'status'
          2        IS_IDENTICAL                                         ~2      ~1, 'active'
          3      > RETURN                                                       ~2
          4*     > RETURN                                                       null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3H9rr
function name:  {closure:/in/3H9rr:33}
number of ops:  13
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
   36     6        FETCH_DIM_IS                                         ~5      !1, 'c_id'
          7        COALESCE                                             ~6      ~5
          8        FETCH_DIM_R                                          ~7      !1, 'r_id'
          9        QM_ASSIGN                                            ~6      ~7
         10        SPACESHIP                                            ~8      ~3, ~6
         11      > RETURN                                                       ~8
   37    12*     > RETURN                                                       null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.4 ms | 1899 KiB | 16 Q