3v4l.org

run code in 300+ PHP versions simultaneously
<?php $t = microtime(true); $n = 100000; $max = 10; $m = memory_get_usage(true); echo 'Serialize' . PHP_EOL; for($i = 0; $i < $max; $i++) { $a = array(); for($i = 0; $i < $n; $i++) { $a[$i] = (int)$i; } } echo 'Peak: ' . memory_get_peak_usage(true) . PHP_EOL; echo 'Usage: ' . (memory_get_usage(true) - $m) . PHP_EOL . PHP_EOL; $content = serialize($a); $a = null; $t = microtime(true); $m = memory_get_usage(true); echo 'Unserialize' . PHP_EOL; for($i = 0; $i < $max; $i++) { $a = unserialize($content); } echo 'Peak: ' . memory_get_peak_usage(true) . PHP_EOL; echo 'Usage: ' . (memory_get_usage(true) - $m) . PHP_EOL; echo 'Time: ' . (microtime(true) - $t) . 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.2.00.0840.09431.18
7.1.70.0070.07929.10
7.1.60.0070.07529.11
7.1.50.0200.09129.16
7.1.00.0000.16734.23
7.0.200.0170.05028.61
7.0.70.0130.14033.74
7.0.60.0100.15033.73
7.0.50.0100.14734.07
7.0.40.0100.14728.13
7.0.30.0170.14028.04
7.0.20.0100.13328.02
7.0.10.0030.15328.16
7.0.00.0100.14728.03
5.6.280.0200.51359.10
5.6.220.0200.53058.76
5.6.210.0230.54058.80
5.6.200.0300.53359.27
5.6.190.0400.51759.05
5.6.180.0170.50759.18
5.6.170.0230.53759.07
5.6.160.0370.46359.17
5.6.150.0230.53359.19
5.6.140.0200.53059.26
5.6.130.0230.52359.14
5.6.120.0230.31752.15
5.6.110.0200.30352.16
5.6.100.0170.33052.11
5.6.90.0330.30752.19
5.6.80.0300.31351.66
5.6.70.0300.31051.50
5.6.60.0330.30050.79
5.6.50.0330.29350.79
5.6.40.0400.30050.89
5.6.30.0170.29050.76
5.6.20.0200.32050.77
5.6.10.0400.28350.77
5.6.00.0330.28050.77
5.5.360.0170.50058.11
5.5.350.0230.54358.11
5.5.340.0230.51058.39
5.5.330.0230.57058.48
5.5.320.0230.53758.51
5.5.310.0170.55058.34
5.5.300.0200.53358.43
5.5.290.0300.53758.41
5.5.280.0370.30752.04
5.5.270.0230.32052.04
5.5.260.0070.31052.05
5.5.250.0270.30751.73
5.5.240.0300.30351.43
5.5.230.0300.29351.47
5.5.220.0170.27350.60
5.5.210.0200.31050.56
5.5.200.0230.26750.66
5.5.190.0270.32050.61
5.5.180.0300.29350.68
5.5.160.0270.24050.50
5.5.150.0270.31350.50
5.5.140.0130.28750.83
5.5.130.0270.29350.45
5.5.120.0270.26050.57
5.5.110.0130.25350.57
5.5.100.0170.30350.41
5.5.90.0170.30050.71
5.5.80.0370.29350.56
5.5.70.0300.30050.54
5.5.60.0170.29750.52
5.5.50.0270.28350.45
5.5.40.0400.30050.42
5.5.30.0270.30050.38
5.5.20.0170.29050.47
5.5.10.0200.29050.45
5.5.00.0230.29750.42

preferences:
37.17 ms | 400 KiB | 5 Q