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) { foreach ($needles as $needle) { if (!in_array($needle, $row)) { return false; } } return true; }) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nvmBJ
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
   46     7        SEND_VAL                                                 ~4
   39     8        DO_ICALL                                         $5      
   46     9        SEND_VAR                                                 $5
   38    10        DO_ICALL                                                 
   47    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 = 13
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/nvmBJ
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $row, !1 = $needles, !2 = $needle
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   40     2      > FE_RESET_R                                       $3      !1, ->13
          3    > > FE_FETCH_R                                               $3, !2, ->13
   41     4    >   INIT_FCALL                                               'in_array'
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $4      
          8        BOOL_NOT                                         ~5      $4
          9      > JMPZ                                                     ~5, ->12
   42    10    >   FE_FREE                                                  $3
         11      > RETURN                                                   <false>
   40    12    > > JMP                                                      ->3
         13    >   FE_FREE                                                  $3
   45    14      > RETURN                                                   <true>
   46    15*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.37 ms | 1008 KiB | 16 Q