3v4l.org

run code in 300+ PHP versions simultaneously
<?php function vowels($str) { for($i = 0, $c = 0; $i < strlen($str); $i++) { if(in_array(substr($str,$i,1),array("a","e","i","o","u"))) $c++; } return "String \"{$str}\": ".strlen($str) / $c."\n"; } echo vowels("The quick brown fox jumps over the lazy dog."); echo vowels("The SSL certificate has been updated");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lAge8
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'vowels'
          1        SEND_VAL                                                 'The+quick+brown+fox+jumps+over+the+lazy+dog.'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   10     4        INIT_FCALL                                               'vowels'
          5        SEND_VAL                                                 'The+SSL+certificate+has+been+updated'
          6        DO_FCALL                                      0  $1      
          7        ECHO                                                     $1
          8      > RETURN                                                   1

Function vowels:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 4
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 4
Branch analysis from position: 16
Branch analysis from position: 4
Branch analysis from position: 12
filename:       /in/lAge8
function name:  vowels
number of ops:  25
compiled vars:  !0 = $str, !1 = $i, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, 0
          2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->13
    4     4    >   INIT_FCALL                                               'substr'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 1
          8        DO_ICALL                                         $5      
          9        IN_ARRAY                                                 $5, <array>
         10      > JMPZ                                                     ~6, ->12
         11    >   PRE_INC                                                  !2
    3    12    >   PRE_INC                                                  !1
         13    >   STRLEN                                           ~9      !0
         14        IS_SMALLER                                               !1, ~9
         15      > JMPNZ                                                    ~10, ->4
    6    16    >   ROPE_INIT                                     3  ~12     'String+%22'
         17        ROPE_ADD                                      1  ~12     ~12, !0
         18        ROPE_END                                      2  ~11     ~12, '%22%3A+'
         19        STRLEN                                           ~14     !0
         20        DIV                                              ~15     ~14, !2
         21        CONCAT                                           ~16     ~11, ~15
         22        CONCAT                                           ~17     ~16, '%0A'
         23      > RETURN                                                   ~17
    7    24*     > RETURN                                                   null

End of function vowels

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.9 ms | 1403 KiB | 17 Q