3v4l.org

run code in 300+ PHP versions simultaneously
<?php $users = [ [ "name" => "ali", "age" => 22, "score" => 12 ], [ "name" => "hasan", "age" => 32, "score" => 52 ], ]; $filters = [ "name" => "ali", "age" => 22 ]; var_export( array_filter( $users, function($row) use($filters) { foreach ($filters as $fkey => $fval) { if ($row[$fkey] != $fval) { return false; } } return true; } ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZPeKh
function name:  (null)
number of ops:  12
compiled vars:  !0 = $users, !1 = $filters
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   16     1        ASSIGN                                                   !1, <array>
   21     2        INIT_FCALL                                               'var_export'
   22     3        INIT_FCALL                                               'array_filter'
   23     4        SEND_VAR                                                 !0
   24     5        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          6        BIND_LEXICAL                                             ~4, !1
   31     7        SEND_VAL                                                 ~4
   22     8        DO_ICALL                                         $5      
   31     9        SEND_VAR                                                 $5
   21    10        DO_ICALL                                                 
   33    11      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/ZPeKh
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $row, !1 = $filters, !2 = $fval, !3 = $fkey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   25     2      > FE_RESET_R                                       $4      !1, ->11
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->11
          4    >   ASSIGN                                                   !3, ~5
   26     5        FETCH_DIM_R                                      ~7      !0, !3
          6        IS_NOT_EQUAL                                             !2, ~7
          7      > JMPZ                                                     ~8, ->10
   27     8    >   FE_FREE                                                  $4
          9      > RETURN                                                   <false>
   25    10    > > JMP                                                      ->3
         11    >   FE_FREE                                                  $4
   30    12      > RETURN                                                   <true>
   31    13*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
132.37 ms | 1012 KiB | 15 Q