3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text="Welcome to PHP"; $searchchar="e"; $count="0"; //zero for($i="0"; $i<strlen($text); $i=$i+1){ if(substr($text,$i,1)==$searchchar){ $count=$count+1; } } echo $count;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 5
Branch analysis from position: 19
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 = 19, Position 2 = 5
Branch analysis from position: 19
Branch analysis from position: 5
Branch analysis from position: 14
filename:       /in/dQrsJ
function name:  (null)
number of ops:  21
compiled vars:  !0 = $text, !1 = $searchchar, !2 = $count, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Welcome+to+PHP'
    3     1        ASSIGN                                                   !1, 'e'
    4     2        ASSIGN                                                   !2, '0'
    6     3        ASSIGN                                                   !3, '0'
          4      > JMP                                                      ->16
    8     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
   10    12    >   ADD                                              ~10     !2, 1
         13        ASSIGN                                                   !2, ~10
    6    14    >   ADD                                              ~12     !3, 1
         15        ASSIGN                                                   !3, ~12
         16    >   STRLEN                                           ~14     !0
         17        IS_SMALLER                                               !3, ~14
         18      > JMPNZ                                                    ~15, ->5
   15    19    >   ECHO                                                     !2
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150 ms | 1387 KiB | 15 Q