3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($str) { if (ltrim($str, 'A..Za..z0..9.') !== '') { return 'found a bad character'; } else { return 'all good'; } } foreach (['good', 'b@d', '$รท*'] as $s) { printf("%s : %s\n", $s, test($s)); }

preferences:
27.72 ms | 405 KiB | 5 Q