3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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");
based on 6Drrc
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
String "The quick brown fox jumps over the lazy dog.": 4 String "The SSL certificate has been updated": 3