3v4l.org

run code in 300+ PHP versions simultaneously
<?php // setting either of these to false will prevent memory leak $assoc = true; $unserialize = true; function formatBytes($size, $precision = 2) { $base = log($size, 1024); $suffixes = [ '', 'K', 'M', 'G', 'T' ]; return round(pow(1024, $base - floor($base)), $precision) .' '. $suffixes[floor($base)]; } function load($str) { global $assoc, $unserialize; $php = serialize($assoc ? [ $str => 1 ] : [ $str ]); if ($unserialize) unserialize($php); } for ($ctr = 0; $ctr < 50000; $ctr++) load("foo_$ctr"); echo 'Usage: ', formatBytes(memory_get_usage()) , "\n"; echo 'Peak: ', formatBytes(memory_get_peak_usage()) , "\n";

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.70.0070.02879.33
8.1.90.0030.02517.71
8.1.80.0050.03317.66
8.1.70.0090.03317.66
8.1.60.0140.02617.82
8.1.50.0180.02317.65
8.1.40.0130.02717.73
8.1.30.0160.03017.81
8.1.20.0140.02717.83
8.1.10.0130.02817.77
8.1.00.0140.02517.77
8.0.220.0050.03621.41
8.0.210.0130.02821.35
8.0.200.0100.03421.44
8.0.190.0110.03321.51
8.0.180.0170.02321.38
8.0.170.0120.03021.44
8.0.160.0130.02821.56
8.0.150.0130.02521.32
8.0.140.0140.02721.39
8.0.130.0120.02821.46
8.0.120.0100.03321.43
8.0.110.0090.02921.39
8.0.100.0090.02821.34
8.0.90.0130.02521.39
8.0.80.0100.02821.36
8.0.70.0120.03621.34
8.0.60.0100.03121.34
8.0.50.0110.02921.34
8.0.30.0110.03621.33
8.0.20.0160.03221.35
8.0.10.0130.03621.47
8.0.00.0140.03921.44
7.4.330.0030.03079.33
7.4.300.0090.03121.01
7.4.290.0160.02720.99
7.4.280.0120.02821.01
7.4.270.0090.03020.92
7.4.260.0150.03021.00
7.4.250.0110.03320.93
7.4.240.0110.02620.94
7.4.230.0100.02920.98
7.4.220.0080.03020.97
7.4.210.0100.02920.96
7.4.200.0110.03720.99
7.4.190.0100.03221.02
7.4.180.0100.03121.07
7.4.160.0150.03521.08
7.4.150.0140.03720.96
7.4.140.0140.04120.96
7.4.130.0140.03220.88
7.4.120.0100.03420.94
7.4.110.0140.03320.95
7.4.100.0150.03020.98
7.4.90.0160.03820.93
7.4.80.0150.03220.89
7.4.70.0110.03920.90
7.4.60.0120.03720.90
7.4.50.0110.03720.90
7.4.40.0110.04120.87
7.4.30.0130.04120.90
7.4.20.0150.03820.93
7.4.10.0150.03520.90
7.4.00.0150.03520.92
7.3.330.0150.02820.82
7.3.320.0160.03020.80
7.3.310.0170.02920.76
7.3.300.0100.03320.84
7.3.290.0120.03120.72
7.3.280.0130.04120.81
7.3.270.0150.03820.77
7.3.260.0190.03820.76
7.3.250.0140.03620.83
7.3.240.0170.03920.80
7.3.230.0160.03620.76
7.3.220.0170.03820.70
7.3.210.0130.03720.70
7.3.200.0150.03820.72
7.3.190.0130.03920.74
7.3.180.0130.03720.73
7.3.170.0160.03820.69
7.3.160.0160.04020.71
7.3.150.0170.03520.71
7.3.140.0150.03720.74
7.3.130.0150.04020.72
7.3.120.0160.04120.76
7.3.110.0160.03520.68
7.3.100.0140.03520.69
7.3.90.0140.03720.97
7.3.80.0170.04020.73
7.3.70.0120.03920.83
7.3.60.0150.03420.97
7.3.50.0190.03120.86
7.3.40.0160.03520.91
7.3.30.0150.04220.85
7.3.20.0170.04321.56
7.3.10.0170.03921.47
7.3.00.0140.04121.46

preferences:
45.02 ms | 400 KiB | 5 Q