3v4l.org

run code in 300+ PHP versions simultaneously
<?php $haystack = 'abcdefghi'; $needle = 'acegi'; function charsExistInString($haystack, $needle) { $haystackChars = count_chars($haystack); $needleChars = str_split($needle); foreach ($needleChars as $c) { if ($haystackChars[ord($c)] == 0) { return false; } } return true; } var_dump(charsExistInString($haystack, $needle));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dQTtm
function name:  (null)
number of ops:  10
compiled vars:  !0 = $haystack, !1 = $needle
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'abcdefghi'
    4     1        ASSIGN                                                   !1, 'acegi'
   20     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'charsexistinstring'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function charsexistinstring:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 21
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 21
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/dQTtm
function name:  charsExistInString
number of ops:  24
compiled vars:  !0 = $haystack, !1 = $needle, !2 = $haystackChars, !3 = $needleChars, !4 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        INIT_FCALL                                               'count_chars'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !2, $5
    9     6        INIT_FCALL                                               'str_split'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !3, $7
   11    10      > FE_RESET_R                                       $9      !3, ->21
         11    > > FE_FETCH_R                                               $9, !4, ->21
   12    12    >   INIT_FCALL                                               'ord'
         13        SEND_VAR                                                 !4
         14        DO_ICALL                                         $10     
         15        FETCH_DIM_R                                      ~11     !2, $10
         16        IS_EQUAL                                                 ~11, 0
         17      > JMPZ                                                     ~12, ->20
   13    18    >   FE_FREE                                                  $9
         19      > RETURN                                                   <false>
   11    20    > > JMP                                                      ->11
         21    >   FE_FREE                                                  $9
   17    22      > RETURN                                                   <true>
   18    23*     > RETURN                                                   null

End of function charsexistinstring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.1 ms | 1394 KiB | 22 Q