3v4l.org

run code in 300+ PHP versions simultaneously
<?php $haystack = 'abcdefghi'; $needle = 'acegi'; function charsExistInString($haystack, $needle) { $haystackChars = count_chars($haystack); var_dump($haystackChars); $needleChars = str_split($needle); foreach ($needleChars as $c) { if (!isset($haystackChars[$c])) { 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/KKCSQ
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'
   22     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 = 14, Position 2 = 21
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
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 = 14
Branch analysis from position: 14
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/KKCSQ
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                                               'var_dump'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                                 
   11     9        INIT_FCALL                                               'str_split'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !3, $8
   13    13      > FE_RESET_R                                       $10     !3, ->21
         14    > > FE_FETCH_R                                               $10, !4, ->21
   14    15    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~11     !2, !4
         16        BOOL_NOT                                         ~12     ~11
         17      > JMPZ                                                     ~12, ->20
   15    18    >   FE_FREE                                                  $10
         19      > RETURN                                                   <false>
   13    20    > > JMP                                                      ->14
         21    >   FE_FREE                                                  $10
   19    22      > RETURN                                                   <true>
   20    23*     > RETURN                                                   null

End of function charsexistinstring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.92 ms | 1403 KiB | 20 Q