3v4l.org

run code in 500+ PHP versions simultaneously
<?php $path = "A000AA00"; $startA = microtime(true); for($i = 0; $i < 100000; $i++) { if (strlen($path) !== 8) { die('Bad string length'); } if (ctype_alpha($path[0]) && ctype_digit($path[1]) && ctype_digit($path[2]) && ctype_digit($path[3]) && ctype_alpha($path[4]) && ctype_alpha($path[5]) && ctype_digit($path[6]) && ctype_digit($path[7])) { // We good } } $endA = microtime(true); echo $endA-$startA;

preferences:
39.85 ms | 678 KiB | 5 Q