3v4l.org

run code in 500+ PHP versions simultaneously
<?php printf("%s\n", PHP_VERSION); echo "\n"; $data = []; $i = 1000; $byteLength = 10; 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.5.70.0110.03317.21
8.5.60.0280.03016.60
8.5.50.0330.02516.93
8.5.40.0280.02616.84
8.5.30.0220.03116.98
8.5.20.0330.02616.89
8.5.10.0160.01317.07
8.5.00.0050.01517.00
8.4.220.0190.03919.74
8.4.210.0310.02119.79
8.4.200.0160.01520.00
8.4.190.0210.03019.91
8.4.180.0290.03419.95
8.4.170.0260.03919.96
8.4.160.0300.03019.95
8.4.150.0320.03719.79
8.4.140.0190.02217.73
8.4.130.0250.02517.69
8.4.120.0150.01717.68
8.4.110.0190.01518.00
8.4.100.0160.01717.93
8.4.90.0310.03317.99
8.4.80.0280.03818.04
8.4.70.0360.02917.98
8.4.60.0340.03018.03
8.4.50.0350.03217.90
8.4.40.0300.02617.95
8.4.30.0190.01617.95
8.4.20.0270.02717.77
8.4.10.0230.03117.89
8.3.310.0360.02718.68
8.3.300.0270.04318.65
8.3.290.0360.03118.34
8.3.280.0300.03818.81
8.3.270.0340.02616.86
8.3.260.0210.01617.03
8.3.250.0160.01817.07
8.3.240.0220.01517.00
8.3.230.0190.01716.88
8.3.220.0160.01416.98
8.3.210.0140.01617.17
8.3.200.0110.01917.02
8.3.190.0180.01517.05
8.3.180.0190.01816.98
8.3.170.0180.01316.85
8.3.160.0140.01916.96
8.3.150.0170.01616.96
8.3.140.0280.01516.74
8.3.130.0300.03816.92
8.3.120.0300.03416.67
8.3.110.0210.01916.90
8.3.100.0350.03616.98
8.3.90.0350.02916.95
8.3.80.0270.01917.01
8.3.70.0330.03117.00
8.3.60.0380.03116.88
8.3.50.0330.02816.73
8.3.40.0330.03618.07
8.3.30.0250.02718.10
8.3.20.0180.03118.35
8.3.10.0260.03318.18
8.3.00.0320.02218.35
8.2.310.0360.03917.97
8.2.300.0310.03518.15
8.2.290.0200.02316.96
8.2.280.0150.01517.02
8.2.270.0120.01816.90
8.2.260.0200.02916.58
8.2.250.0140.01816.76
8.2.240.0250.03116.98
8.2.230.0190.03316.61
8.2.220.0300.02816.77
8.2.210.0330.03816.89
8.2.200.0310.03216.81
8.2.190.0260.04116.74
8.2.180.0290.03716.75
8.2.170.0240.03218.18
8.2.160.0270.03518.27
8.2.150.0230.03118.26
8.2.140.0170.03518.07
8.2.130.0290.03918.03
8.2.120.0190.03117.97
8.2.110.0110.02018.13
8.2.100.0150.01518.20
8.2.90.0260.03318.27
8.2.80.0260.02418.01
8.2.70.0130.02018.11
8.2.60.0260.02218.02
8.2.50.0140.02218.08
8.2.40.0280.03318.12
8.2.30.0170.02918.22
8.2.20.0360.03718.09
8.2.10.0110.03718.03
8.2.00.0160.03618.06
8.1.340.0280.03717.90
8.1.330.0220.02916.35
8.1.320.0290.02616.29
8.1.310.0160.02116.48
8.1.300.0230.03016.53
8.1.290.0130.02116.50
8.1.280.0130.02216.44
8.1.270.0120.02217.93
8.1.260.0130.04717.95
8.1.250.0200.02717.93
8.1.240.0200.02617.76
8.1.230.0240.02717.93
8.1.220.0160.02617.70
8.1.210.0280.04817.71
8.1.200.0230.04317.89
8.1.190.0260.03517.78
8.1.180.0260.05217.91
8.1.170.0130.02017.89
8.1.160.0190.04617.97
8.1.150.0280.04817.85
8.1.140.0110.02817.77
8.1.130.0150.04317.71
8.1.120.0160.04317.77
8.1.110.0160.03617.77
8.1.100.0150.03617.87
8.1.90.0130.02617.81
8.1.80.0080.03217.79
8.1.70.0100.02917.78
8.1.60.0150.04217.86
8.1.50.0110.04117.83
8.1.40.0260.03417.93
8.1.30.0120.04517.86
8.1.20.0200.04017.91
8.1.10.0180.04417.98
8.1.00.0160.03617.89
8.0.300.0130.02817.36
8.0.290.0290.04917.12
8.0.280.0220.04417.47
8.0.270.0090.04717.27
8.0.260.0140.04217.29
8.0.250.0100.04417.34
8.0.240.0190.04417.29
8.0.230.0140.04517.23
8.0.220.0160.04917.14
8.0.210.0090.04717.17
8.0.200.0080.04417.19
8.0.190.0100.04117.15
8.0.180.0200.05817.20
8.0.170.0180.04517.21
8.0.160.0200.04617.23
8.0.150.0190.04617.16
8.0.140.0180.05217.13
8.0.130.0150.05117.14
8.0.120.0100.04117.11
8.0.110.0120.04217.06
8.0.100.0130.04716.89
8.0.90.0170.04316.99
8.0.80.0170.04716.99
8.0.70.0060.05117.06
8.0.60.0220.04417.08
8.0.50.0190.04817.04
8.0.30.0080.04117.09
8.0.20.0100.05217.12
8.0.10.0090.04317.10

preferences:
45.44 ms | 1161 KiB | 5 Q