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.5.00.0120.03617.24
8.4.150.0300.04019.77
8.4.140.0340.03717.81
8.4.130.0320.03717.91
8.4.120.0360.03417.92
8.4.110.0400.03317.97
8.4.100.0360.03717.97
8.4.90.0390.04417.94
8.4.80.0390.03717.99
8.4.70.0320.03518.00
8.4.60.0370.03417.92
8.4.50.0360.03617.89
8.4.40.0380.03817.73
8.4.30.0370.03717.60
8.4.20.0400.03517.66
8.4.10.0400.03817.87
8.3.280.0320.03718.59
8.3.270.0350.03816.84
8.3.260.0340.03816.88
8.3.250.0320.03516.91
8.3.240.0330.03716.90
8.3.230.0350.04216.96
8.3.220.0380.03716.78
8.3.210.0340.03516.84
8.3.200.0360.03516.72
8.3.190.0310.04016.80
8.3.180.0340.02916.77
8.3.170.0360.04016.70
8.3.160.0390.04116.81
8.3.150.0360.03516.78
8.3.140.0370.03816.83
8.3.130.0310.03816.81
8.3.120.0310.03917.28
8.3.110.0330.03916.70
8.3.100.0370.03816.80
8.3.90.0400.03316.74
8.3.80.0360.03616.76
8.3.70.0400.03416.84
8.3.60.0350.03716.76
8.3.50.0390.03516.73
8.3.40.0320.03918.21
8.3.30.0260.03817.95
8.3.20.0250.03418.08
8.3.10.0250.04018.18
8.3.00.0240.03818.52
8.2.290.0280.03616.84
8.2.280.0290.03316.70
8.2.270.0300.03616.81
8.2.260.0310.03416.72
8.2.250.0320.03416.63
8.2.240.0310.03516.72
8.2.230.0320.03416.67
8.2.220.0330.03316.64
8.2.210.0300.03416.63
8.2.200.0310.03516.67
8.2.190.0320.04216.66
8.2.180.0290.03516.72
8.2.170.0310.03518.20
8.2.160.0280.03418.19
8.2.150.0300.03618.23
8.2.140.0310.03418.05
8.2.130.0270.03518.06
8.2.120.0290.03618.19
8.2.110.0280.03718.28
8.2.100.0270.03618.16
8.2.90.0280.03518.03
8.2.80.0300.03417.94
8.2.70.0170.03353.04
8.2.60.0260.03718.12
8.2.50.0270.03718.13
8.2.40.0290.03518.04
8.2.30.0300.03418.05
8.2.20.0290.03518.14
8.2.10.0310.03517.92
8.2.00.0300.03617.84
8.1.330.0310.03416.27
8.1.320.0290.03416.28
8.1.310.0280.03516.23
8.1.300.0290.04116.20
8.1.290.0320.03716.24
8.1.280.0280.04116.29
8.1.270.0320.03417.87
8.1.260.0300.03517.84
8.1.250.0280.03817.84
8.1.240.0240.03517.92
8.1.230.0290.03817.79
8.1.220.0290.03517.87
8.1.210.0270.04017.79
8.1.200.0270.03717.74
8.1.190.0280.03417.71
8.1.180.0300.03617.74
8.1.170.0290.03717.71
8.1.160.0290.03317.83
8.1.150.0260.04217.79
8.1.140.0270.03917.86
8.1.130.0300.03417.80
8.1.120.0280.04117.84
8.1.110.0280.03917.88
8.1.100.0240.03617.88
8.1.90.0160.03417.76
8.1.80.0190.03517.78
8.1.70.0200.03717.69
8.1.60.0240.03217.89
8.1.50.0260.03217.77
8.1.40.0170.03317.91
8.1.30.0230.03217.95
8.1.20.0200.03017.92
8.1.10.0180.03317.84
8.1.00.0210.02918.05
8.0.300.0320.04021.87
8.0.290.0330.03821.85
8.0.280.0340.03821.81
8.0.270.0350.03421.81
8.0.260.0310.03921.78
8.0.250.0310.03421.85
8.0.240.0310.03821.86
8.0.230.0280.03921.92
8.0.220.0200.03621.69
8.0.210.0250.03421.60
8.0.200.0220.03521.69
8.0.190.0230.03421.82
8.0.180.0230.02921.72
8.0.170.0230.03521.76
8.0.160.0240.03521.75
8.0.150.0190.02921.52
8.0.140.0190.03221.62
8.0.130.0200.03421.58
8.0.120.0190.03421.61
8.0.110.0170.03121.57
8.0.100.0160.03121.47
8.0.90.0190.02921.53
8.0.80.0160.03221.48
8.0.70.0170.03721.43
8.0.60.0150.03321.45
8.0.50.0160.03121.48
8.0.30.0160.03621.42
8.0.20.0190.03421.49
8.0.10.0170.03621.60
8.0.00.0190.03821.58
7.4.330.0210.03244.70
7.4.320.0300.03721.58
7.4.300.0170.03421.20
7.4.290.0240.03421.42
7.4.280.0220.03421.29
7.4.270.0150.03221.11
7.4.260.0220.03221.28
7.4.250.0200.03421.24
7.4.240.0160.02821.09
7.4.230.0170.03221.15
7.4.220.0150.03421.14
7.4.210.0160.03221.11
7.4.200.0170.03721.13
7.4.190.0160.03421.16
7.4.180.0170.03321.21
7.4.160.0180.03721.22
7.4.150.0180.03521.08
7.4.140.0180.04021.06
7.4.130.0170.03321.01
7.4.120.0150.03521.04
7.4.110.0170.03421.07
7.4.100.0180.03321.09
7.4.90.0190.03821.05
7.4.80.0190.03321.01
7.4.70.0150.03821.03
7.4.60.0160.03721.03
7.4.50.0150.03621.02
7.4.40.0160.04021.00
7.4.30.0160.04021.00
7.4.20.0190.03821.05
7.4.10.0190.03421.00
7.4.00.0180.03421.04
7.3.330.0200.03420.99
7.3.320.0220.03720.94
7.3.310.0210.03220.98
7.3.300.0150.03421.02
7.3.290.0180.03420.93
7.3.280.0170.04120.92
7.3.270.0170.03821.04
7.3.260.0200.04020.92
7.3.250.0170.03720.94
7.3.240.0200.03920.93
7.3.230.0180.03720.91
7.3.220.0200.04020.86
7.3.210.0170.03920.83
7.3.200.0190.03820.85
7.3.190.0160.03920.90
7.3.180.0180.03920.83
7.3.170.0190.03920.83
7.3.160.0190.04020.83
7.3.150.0200.03620.86
7.3.140.0180.03720.88
7.3.130.0180.04020.87
7.3.120.0190.03920.88
7.3.110.0200.03720.76
7.3.100.0180.03520.82
7.3.90.0180.03721.09
7.3.80.0210.03820.85
7.3.70.0150.04020.97
7.3.60.0180.03521.07
7.3.50.0220.03421.01
7.3.40.0180.03521.07
7.3.30.0180.04021.00
7.3.20.0190.04121.82
7.3.10.0180.03821.70
7.3.00.0160.04021.71

preferences:
30.92 ms | 403 KiB | 5 Q