bench
<?php $time_start = microtime(true); for ($i = 0; $i < 1000; ++$i) { if (preg_match("/[0-9]+/", $i)) { echo null; } } $time_end = microtime(true); $time = $time_end - $time_start; echo "{$time} seconds\n";