3v4l.org

run code in 500+ PHP versions simultaneously
<?php $needles = ['a', 'c', 'g']; $myString = 'abcdefh'; var_dump(searchString($needles, $myString)); function searchString(array $needles, string $haystack): ?array { $itemsFound = []; foreach($needles as $needle) { if (strpos($haystack, $needle) !== false) { $itemsFound[] = $needle; } } return $itemsFound; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5oXGp
function name:  (null)
number of ops:  10
compiled vars:  !0 = $needles, !1 = $myString
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
    3     1        ASSIGN                                                       !1, 'abcdefh'
    5     2        INIT_FCALL                                                   'var_dump'
          3        INIT_FCALL_BY_NAME                                           'searchString'
          4        SEND_VAR_EX                                                  !0
          5        SEND_VAR_EX                                                  !1
          6        DO_FCALL                                          0  $4      
          7        SEND_VAR                                                     $4
          8        DO_ICALL                                                     
   17     9      > RETURN                                                       1

Function searchstring:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/5oXGp
function name:  searchString
number of ops:  16
compiled vars:  !0 = $needles, !1 = $haystack, !2 = $itemsFound, !3 = $needle
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    9     2        ASSIGN                                                       !2, <array>
   10     3      > FE_RESET_R                                           $5      !0, ->11
          4    > > FE_FETCH_R                                                   $5, !3, ->11
   11     5    >   FRAMELESS_ICALL_2                strpos              ~6      !1, !3
          6        TYPE_CHECK                                      1018          ~6
          7      > JMPZ                                                         ~7, ->10
   12     8    >   ASSIGN_DIM                                                   !2
          9        OP_DATA                                                      !3
   10    10    > > JMP                                                          ->4
         11    >   FE_FREE                                                      $5
   16    12        VERIFY_RETURN_TYPE                                           !2
         13      > RETURN                                                       !2
   17    14*       VERIFY_RETURN_TYPE                                           
         15*     > RETURN                                                       null

End of function searchstring

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.72 ms | 2049 KiB | 14 Q