3v4l.org

run code in 500+ PHP versions simultaneously
<?php /** * Check if an array contains any value in a set. ** * @param array $array * @param array $subset * @param bool $strict Strict type checking * @return bool */ $a=array(1,'test'); $b=array(2,'test'); function array_contains_any_val(array $array, array $subset, bool $strict = false) :bool { $contains = false; foreach ($subset as $value) { if (in_array($value, $array, $strict)) { $contains = true; break; } } return $contains; } var_dump(array_contains_any_val($a, $b));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J68Ih
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                       !0, <array>
   11     1        ASSIGN                                                       !1, <array>
   25     2        INIT_FCALL                                                   'var_dump'
          3        INIT_FCALL                                                   'array_contains_any_val'
          4        SEND_VAR                                                     !0
          5        SEND_VAR                                                     !1
          6        DO_FCALL                                          0  $4      
          7        SEND_VAR                                                     $4
          8        DO_ICALL                                                     
          9      > RETURN                                                       1

Function array_contains_any_val:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 12
Branch analysis from position: 12
filename:       /in/J68Ih
function name:  array_contains_any_val
number of ops:  17
compiled vars:  !0 = $array, !1 = $subset, !2 = $strict, !3 = $contains, !4 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV_INIT                                            !2      <false>
   15     3        ASSIGN                                                       !3, <false>
   16     4      > FE_RESET_R                                           $6      !1, ->12
          5    > > FE_FETCH_R                                                   $6, !4, ->12
   17     6    >   FRAMELESS_ICALL_3                in_array            ~7      !4, !0
          7        OP_DATA                                                      !2
          8      > JMPZ                                                         ~7, ->11
   18     9    >   ASSIGN                                                       !3, <true>
   19    10      > JMP                                                          ->12
   16    11    > > JMP                                                          ->5
         12    >   FE_FREE                                                      $6
   22    13        VERIFY_RETURN_TYPE                                           !3
         14      > RETURN                                                       !3
   23    15*       VERIFY_RETURN_TYPE                                           
         16*     > RETURN                                                       null

End of function array_contains_any_val

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
229.46 ms | 2213 KiB | 15 Q