3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ ['id' => 1, 'user_id' => 1, 'assignment_id' => 1, 'grade' => 90], ['id' => 2, 'user_id' => 3, 'assignment_id' => 2, 'grade' => 85], ['id' => 3, 'user_id' => 5, 'assignment_id' => 5, 'grade' => 66], ]; $rules = ['user_id' => 3, 'assignment_id' => 2]; var_export( array_filter( $data, fn($row) => !array_diff_assoc($rules, $row) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/etQPp
function name:  (null)
number of ops:  12
compiled vars:  !0 = $data, !1 = $rules
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   11     2        INIT_FCALL                                               'var_export'
   12     3        INIT_FCALL                                               'array_filter'
   13     4        SEND_VAR                                                 !0
   14     5        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          6        BIND_LEXICAL                                             ~4, !1
   15     7        SEND_VAL                                                 ~4
   12     8        DO_ICALL                                         $5      
   15     9        SEND_VAR                                                 $5
   11    10        DO_ICALL                                                 
   16    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/etQPp
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $row, !1 = $rules
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        INIT_FCALL                                               'array_diff_assoc'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        BOOL_NOT                                         ~3      $2
          7      > RETURN                                                   ~3
   15     8*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.2 ms | 999 KiB | 16 Q