3v4l.org

run code in 300+ PHP versions simultaneously
<?php printf("%s\n", PHP_VERSION); echo "\n"; $data = []; $i = 1000; $byteLength = 10000; while ($i--) { $data[] = base64_encode(random_bytes($byteLength)); } // PCRE $max = 100; $start = microtime(true); for ($c = 0; $c < $max; $c++) { for ($i = 0; $i < 1000; $i++) { $value = $data[$i]; false !== preg_match('~~u', $value); } } printf("Took %.7f seconds per execution\n", (microtime(true) - $start) / $max); echo "\n"; // mbstring $max = 100; $start = microtime(true); for ($c = 0; $c < $max; $c++) { for ($i = 0; $i < 1000; $i++) { $value = $data[$i]; false !== mb_check_encoding($value, 'UTF-8'); } } printf("Took %.7f seconds per execution\n", (microtime(true) - $start) / $max);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.2.10.0461.65633.20
8.2.00.0501.58933.10
8.1.140.0431.96233.27
8.1.130.0371.97333.30
8.1.120.0371.97333.43
8.1.110.0371.97233.45
8.1.100.0371.96933.49
8.1.90.0471.95533.34
8.1.80.0371.96833.46
8.1.70.0531.94433.38
8.1.60.0371.96733.50
8.1.50.0401.96633.43
8.1.40.0371.96933.60
8.1.30.0401.96033.56
8.1.20.0471.95333.59
8.1.10.0501.94933.66
8.1.00.0371.97033.53
8.0.270.0371.96732.77
8.0.260.0461.95832.72
8.0.250.0431.96132.80
8.0.240.0431.96132.84
8.0.230.0491.95332.73
8.0.220.0371.96832.68
8.0.210.0331.97132.84
8.0.200.0301.97532.64
8.0.190.0331.96932.77
8.0.180.0401.96232.81
8.0.170.0301.97132.76
8.0.160.0301.97732.77
8.0.150.0431.96132.75
8.0.140.0401.96232.71
8.0.130.0371.96532.61
8.0.120.0371.96132.62
8.0.110.0491.95132.55
8.0.100.0431.95132.59
8.0.90.0501.93532.63
8.0.80.0531.95132.49
8.0.70.0581.93632.62
8.0.60.0461.94932.68
8.0.50.0501.94632.59
8.0.30.0571.94632.55
8.0.20.0531.93932.66
8.0.10.0331.97732.70

preferences:
25.66 ms | 403 KiB | 5 Q