3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text="tafadzwarutsvara"; $search_char="a"; $count="0"; for($x="0"; $x<strlen($text); $x++) { if(substr($text,$x,1)==$search_char) { $count=$count+1; } } echo $count; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 5
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 5
Branch analysis from position: 18
Branch analysis from position: 5
Branch analysis from position: 14
filename:       /in/rXS7K
function name:  (null)
number of ops:  20
compiled vars:  !0 = $text, !1 = $search_char, !2 = $count, !3 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'tafadzwarutsvara'
    3     1        ASSIGN                                                   !1, 'a'
    4     2        ASSIGN                                                   !2, '0'
    5     3        ASSIGN                                                   !3, '0'
          4      > JMP                                                      ->15
    7     5    >   INIT_FCALL                                               'substr'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !3
          8        SEND_VAL                                                 1
          9        DO_ICALL                                         $8      
         10        IS_EQUAL                                                 !1, $8
         11      > JMPZ                                                     ~9, ->14
    9    12    >   ADD                                              ~10     !2, 1
         13        ASSIGN                                                   !2, ~10
    5    14    >   PRE_INC                                                  !3
         15    >   STRLEN                                           ~13     !0
         16        IS_SMALLER                                               !3, ~13
         17      > JMPNZ                                                    ~14, ->5
   12    18    >   ECHO                                                     !2
   13    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.3 ms | 1395 KiB | 15 Q