3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $a; public function __construct() { $this->a = function () { return true; }; } public function doAction() { $result = array(); for ($i = 0; $i < 100; ++$i) { $result[] = mt_rand(); } call_user_func($this->a); } } for ($i = 0; $i < 10000; ++$i) { var_dump(memory_get_usage(true)); $a = new A(); $a->doAction(); //gc_collect_cycles(); //this fixes 5.5 }

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.100.1250.01315.64
7.2.90.0180.01815.88
7.2.80.3360.02415.66
7.2.70.0220.02216.16
7.2.60.2020.02616.01
7.2.50.0920.04215.79
7.2.40.0470.03216.54
7.2.30.0660.03915.93
7.2.20.1650.01915.98
7.2.10.0690.02515.91
7.2.00.0920.03917.07
7.1.220.2340.01714.88
7.1.210.2090.01614.99
7.1.200.0110.03714.91
7.1.190.0450.01814.82
7.1.180.0490.03815.41
7.1.170.0080.04015.18
7.1.160.0330.01614.76
7.1.150.0260.02614.83
7.1.140.1260.01615.20
7.1.130.0270.01714.91
7.1.120.0440.03414.90
7.1.110.0800.02914.95
7.1.100.0200.02314.97
7.1.90.0140.02315.26
7.1.80.0760.02514.83
7.1.70.0190.02814.60
7.1.60.0710.01933.08
7.1.50.0480.03433.03
7.1.40.0630.02233.77
7.1.30.0500.02133.00
7.1.20.0470.01632.79
7.1.10.0710.01614.70
7.1.00.0170.02514.71
7.0.310.1610.03014.65
7.0.300.0190.02214.66
7.0.290.1670.02414.69
7.0.280.1120.02914.71
7.0.270.0250.01614.82
7.0.260.1300.01514.67
7.0.250.0290.01614.71
7.0.240.0250.02014.87
7.0.230.0330.01714.74
7.0.220.0300.04714.81
7.0.210.0590.02214.82
7.0.200.0250.02814.54
7.0.190.1040.03414.67
7.0.180.0610.03915.12
7.0.170.0310.02714.50
7.0.160.0340.01214.32
7.0.150.0470.01814.64
7.0.140.0480.02614.68
7.0.130.0300.01814.83
7.0.120.1960.02114.77
7.0.110.0800.03214.59
7.0.100.1080.01314.67
7.0.90.0790.02515.06
7.0.80.1710.02714.87
7.0.70.1010.02414.32
7.0.60.0350.01514.42
7.0.50.1020.02415.01
5.6.380.0150.06216.17
5.6.370.0220.07216.19
5.6.360.0210.04516.72
5.6.350.0170.07216.90
5.6.340.0310.08618.04
5.6.330.0240.03816.05
5.6.320.0270.06216.57
5.6.310.0220.05616.75
5.6.300.0260.04415.83
5.6.290.0250.07717.02
5.6.280.0240.05015.93
5.6.270.0260.06616.12
5.6.260.0210.08916.53
5.6.250.0390.08217.59
5.6.240.0310.07317.83
5.6.230.0220.08916.48
5.6.220.0190.06816.44
5.6.210.0180.05416.51
5.6.200.0200.06116.20
5.6.190.0330.04516.26
5.5.380.0300.09814.68
5.5.370.0300.05112.86
5.5.360.0180.05712.93
5.5.350.0300.07612.94
5.5.340.0220.06613.20
5.5.330.0260.04713.11

preferences:
38.87 ms | 401 KiB | 5 Q