3v4l.org

run code in 300+ PHP versions simultaneously
<?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");

preferences:
35.2 ms | 402 KiB | 5 Q