3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myArray = [[ 'site_id' => 'S6407', 'tssr_id' => 'TSSRBOQ-200204-0145-59', 'site_name' => 'Site S6407', 'id_site_doc'=> '127361', 'implementation_id' => 'imp4121', 'status' => 'implementation_created', 'endstate' => false ], [ 'site_id' => 'S5910', 'tssr_id' => 'TSSRBOQ-200204-0145-8', 'site_name' => 'Site S5910', 'id_site_doc'=> '127362', 'implementation_id' => 'imp4122', 'status' => 'implementation_created', 'endstate' => true ]]; $array_validate = [[ 'site_id' => 'S5910', 'tssr_id' => 'TSSRBOQ-200204-0145-8' ], [ 'site_id' => 'S6407', 'tssr_id' => 'TSSRBOQ-200204-0145-59' ]]; $validEntries = array_filter($myArray, static function (array $entry) use ($array_validate): bool { return in_array([ 'site_id' => $entry['site_id'], 'tssr_id' => $entry['tssr_id'] ], $array_validate, true); }); print_r($validEntries);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4Qhmr
function name:  (null)
number of ops:  13
compiled vars:  !0 = $myArray, !1 = $array_validate, !2 = $validEntries
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   21     1        ASSIGN                                                   !1, <array>
   29     2        INIT_FCALL                                               'array_filter'
          3        SEND_VAR                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                          ~5      [0]
          5        BIND_LEXICAL                                             ~5, !1
   34     6        SEND_VAL                                                 ~5
   29     7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !2, $6
   36     9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
         12      > 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/4Qhmr
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $entry, !1 = $array_validate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   30     2        INIT_FCALL                                               'in_array'
   31     3        FETCH_DIM_R                                      ~2      !0, 'site_id'
          4        INIT_ARRAY                                       ~3      ~2, 'site_id'
   32     5        FETCH_DIM_R                                      ~4      !0, 'tssr_id'
          6        ADD_ARRAY_ELEMENT                                ~3      ~4, 'tssr_id'
          7        SEND_VAL                                                 ~3
   33     8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 <true>
   30    10        DO_ICALL                                         $5      
   33    11        VERIFY_RETURN_TYPE                                       $5
         12      > RETURN                                                   $5
   34    13*       VERIFY_RETURN_TYPE                                       
         14*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.04 ms | 1001 KiB | 16 Q