3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function vowelRatio($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 "Vowel ratio for string \"{$str}\": ".strlen($str) / $c."\n"; } echo vowelRatio("The quick brown fox jumps over the lazy dog."); echo vowelRatio("The SSL certificate has been updated");
based on lAge8
Output for 4.3.0 - 7.1.0
Vowel ratio for string "The quick brown fox jumps over the lazy dog.": 4 Vowel ratio for string "The SSL certificate has been updated": 3