3v4l.org

run code in 300+ PHP versions simultaneously
<?php $filename = 'fgdsahktyrewagfbdhzbvt74tf.gfdhsgfghsdf.gsdfhjgfdsg.gsfdghfdsh.dtasfghsdghg.tar.gz'; $t1 = microtime(true); for ($i = 0; $i < 100000; ++$i) { $e1 = substr($filename, strrpos($filename, '.') + 1); } $t2 = microtime(true); for ($n = 0; $n < 100000; ++$n) { $e2 = pathinfo($filename, \PATHINFO_EXTENSION); } $t3 = microtime(true); for ($j = 0; $j < 100000; ++$j) { $e3 = substr(strrchr($filename, '.'), 1); } $t4 = microtime(true); echo '1: ' . ($t2-$t1), PHP_EOL; echo '2: ' . ($t3-$t2), PHP_EOL; echo '3: ' . ($t4-$t3), PHP_EOL;

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)
7.4.10.0030.32915.03
7.4.00.0020.41014.71
7.3.130.0030.43815.16
7.3.120.0070.45614.78
7.3.110.0070.42314.49
7.3.100.0030.32014.46
7.3.90.0070.40314.66
7.3.80.0070.36415.01
7.3.70.0180.36914.69
7.3.60.0020.31114.80
7.3.50.0080.34114.80
7.3.40.0080.33514.83
7.3.30.0030.35014.80
7.3.20.0020.42315.51
7.3.10.0110.30915.72
7.3.00.0130.33815.68
7.2.260.0100.26215.26
7.2.250.0130.37515.25
7.2.240.0030.39215.01
7.2.230.0030.26115.02
7.2.220.0110.35314.95
7.2.210.0050.33315.12
7.2.200.0050.30914.74
7.2.190.0050.31614.90
7.2.180.0120.31314.86
7.2.170.0080.31715.02
7.2.160.0070.32414.96
7.2.150.0120.29615.99
7.2.140.0110.34215.89
7.2.130.0100.33015.91
7.2.120.0100.39115.90
7.2.110.0020.38016.03
7.2.100.0050.30415.94
7.2.90.0030.38316.03
7.2.80.0080.30016.01
7.2.70.0070.38216.09
7.2.60.0100.31815.87
7.2.50.0050.36315.97
7.2.40.0030.35816.11
7.2.30.0130.32216.00
7.2.20.0120.40415.83
7.2.10.0080.39115.89
7.2.00.0070.32716.12
7.1.330.0070.29615.66
7.1.320.0100.42014.87
7.1.310.0110.35314.87
7.1.300.0060.34814.83
7.1.290.0100.32914.82
7.1.280.0100.36814.86
7.1.270.0080.35414.94
7.1.260.0070.35014.78
7.1.250.0130.44214.76
7.1.240.0000.35615.88
7.1.230.0100.33515.80
7.1.220.0030.39615.87
7.1.210.0100.31615.72
7.1.200.0030.29115.80
7.1.190.0030.33615.91
7.1.180.0070.32715.98
7.1.170.0000.29115.69
7.1.160.0030.30215.77
7.1.150.0030.31915.89
7.1.140.0030.29115.79
7.1.130.0070.49015.52
7.1.120.0030.28915.52
7.1.110.0030.43415.94
7.1.100.0100.31215.89
7.1.90.0170.40715.92
7.1.80.0070.34515.64
7.1.70.0030.31315.62
7.1.60.0030.38115.78
7.1.50.0030.32315.83
7.1.40.0000.36515.72
7.1.30.0100.31015.76
7.1.20.0000.33415.80
7.1.10.0070.29915.77
7.1.00.0100.29615.74

preferences:
27.11 ms | 403 KiB | 5 Q