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 = new SplFixedArray($n); 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.0030.25239.04
7.1.70.0230.07736.77
7.1.60.0130.09937.11
7.1.50.0000.15037.07
7.1.00.0200.19042.21
7.0.200.0640.20136.63
7.0.60.1200.29037.54
7.0.50.0600.21737.92
7.0.40.0870.19337.90
7.0.30.0830.20737.96
7.0.20.0700.21337.84
7.0.10.0830.20338.06
7.0.00.0870.18737.89
5.6.280.0200.85360.78
5.6.210.1002.08760.22
5.6.200.0801.69761.01
5.6.190.0501.74060.74
5.6.180.0671.65360.74
5.6.170.0531.72060.85
5.6.160.0731.65060.91
5.6.150.0631.66060.84
5.6.140.0671.72760.73
5.6.130.0501.72060.74
5.6.120.0571.09048.54
5.6.110.0301.14348.52
5.6.100.0531.04748.62
5.6.90.0701.14348.57
5.6.80.0431.18048.11
5.6.70.0731.13747.93
5.6.60.0531.11747.90
5.6.50.0471.01347.96
5.6.40.0671.15747.83
5.6.30.0571.01347.92
5.6.20.0731.17347.93
5.6.10.0371.11347.90
5.6.00.0671.13047.98
5.5.350.1001.87760.07
5.5.340.0731.76760.59
5.5.330.0571.64360.57
5.5.320.0531.68360.67
5.5.310.0601.69760.67
5.5.300.0531.59360.46
5.5.290.0731.59060.73
5.5.280.0631.13048.37
5.5.270.0571.04748.38
5.5.260.0631.09348.37
5.5.250.0671.13048.20
5.5.240.0431.16047.77
5.5.230.0371.15747.72
5.5.220.0601.08747.75
5.5.210.0871.10047.60
5.5.200.0571.26347.75
5.5.190.0531.09047.58
5.5.180.0531.14047.81
5.5.160.0601.16347.89
5.5.150.0471.18347.68
5.5.140.0531.16347.64
5.5.130.0601.09347.73
5.5.120.0631.12047.73
5.5.110.0471.16347.65
5.5.100.0271.22347.58
5.5.90.0471.16747.70
5.5.80.0771.12747.80
5.5.70.0601.09747.70
5.5.60.0331.15047.67
5.5.50.0631.09747.61
5.5.40.0401.10047.44
5.5.30.0601.10747.59
5.5.20.0771.06747.68
5.5.10.0831.08047.75
5.5.00.0601.28747.47

preferences:
30.42 ms | 401 KiB | 5 Q