3v4l.org

run code in 300+ PHP versions simultaneously
<?php $datas = [ [ 'id' => 2135, 'first_name' => 'John', 'last_name' => 'Doe', 'gender' => 'male' ], [ 'id' => 3245, 'first_name' => 'Sally', 'last_name' => 'Smith', 'gender' => 'female' ], [ 'id' => 5342, 'first_name' => 'Jane', 'last_name' => 'Doe', 'gender' => 'female' ], [ 'id' => 5623, 'first_name' => 'Peter', 'last_name' => 'Doe', 'gender' => 'male' ], [ 'id' => 7216, 'first_name' => 'Mike', 'last_name' => 'Lill', 'gender' => 'male' ] ]; $needles = ['Doe', 'male']; var_export( array_filter($datas, function($row) use ($needles) { return !array_diff($needles, $row); }) ); /* echo "\n---\n"; var_export( array_filter($datas, fn($row) => !array_diff($needles, $row)) ); */
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vXSTj
function name:  (null)
number of ops:  12
compiled vars:  !0 = $datas, !1 = $needles
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   36     1        ASSIGN                                                   !1, <array>
   38     2        INIT_FCALL                                               'var_export'
   39     3        INIT_FCALL                                               'array_filter'
          4        SEND_VAR                                                 !0
          5        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          6        BIND_LEXICAL                                             ~4, !1
   41     7        SEND_VAL                                                 ~4
   39     8        DO_ICALL                                         $5      
   41     9        SEND_VAR                                                 $5
   38    10        DO_ICALL                                                 
   49    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/vXSTj
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $row, !1 = $needles
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   40     2        INIT_FCALL                                               'array_diff'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        BOOL_NOT                                         ~3      $2
          7      > RETURN                                                   ~3
   41     8*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.77 ms | 1007 KiB | 16 Q