3v4l.org

run code in 300+ PHP versions simultaneously
<?php $first = []; for ($i = 1; $i <= 1000; $i++) { $str = (string)$i; $first[$str[0]]++; } var_dump($first);

preferences:
35.24 ms | 402 KiB | 5 Q