3v4l.org

run code in 300+ PHP versions simultaneously
<?php class derp { public function __construct($v) { $this->num = $v; } public function getNum() { return $this->num; } } $d = array(); for($i = 0; $i < 100; $i++) { $d[] = new derp(rand(1,100)); } $nums = array_reduce($d, function($nums, $derp) { $nums += $derp->getNum(); }); var_dump($nums);

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.3.120.0000.01114.64
7.3.110.0030.00914.75
7.3.100.0040.00814.76
7.3.90.0060.00615.04
7.3.80.0120.00714.86
7.3.70.0060.00614.67
7.3.60.0000.01014.58
7.3.50.0030.00714.84
7.3.40.0000.01414.88
7.3.30.0030.01014.71
7.3.20.0140.00016.69
7.3.10.0060.00316.71
7.3.00.0040.01116.32
7.2.240.0060.00815.28
7.2.230.0070.00414.86
7.2.220.0030.00615.23
7.2.210.0130.00014.89
7.2.200.0030.00615.24
7.2.190.0090.00614.80
7.2.180.0090.00614.96
7.2.170.0070.01015.20
7.2.160.0060.00815.16
7.2.150.0060.00917.06
7.2.140.0090.00616.93
7.2.130.0030.00917.04
7.2.120.0070.00316.88
7.2.110.0110.00417.03
7.2.100.0100.00617.03
7.2.90.0030.01016.74
7.2.80.0040.00716.79
7.2.70.0110.00416.79
7.2.60.0080.00417.06
7.2.50.0040.00816.91
7.2.40.0060.00916.86
7.2.30.0070.00716.82
7.2.20.0040.00816.92
7.2.10.0040.01116.95
7.2.00.0100.00418.26
7.1.330.0000.00915.76
7.1.320.0030.01015.61
7.1.310.0030.00715.52
7.1.300.0060.00915.76
7.1.290.0030.00715.92
7.1.280.0000.01515.76
7.1.270.0030.00615.90
7.1.260.0060.00915.84
7.1.250.0080.00615.88
7.1.70.0030.00617.15
7.1.60.0070.01019.21
7.1.50.0200.01334.77
7.1.00.0030.06022.37
7.0.200.0100.00614.73
7.0.140.0070.06722.08
7.0.60.0070.08019.92
7.0.50.0030.06017.92
7.0.40.0030.04320.40
7.0.30.0330.07320.21
7.0.20.0300.04320.09
7.0.10.0230.07720.09
7.0.00.0070.05020.07
5.6.210.0030.09020.64
5.6.200.0070.05318.29
5.6.190.0100.04720.46
5.6.180.0170.04320.68
5.6.170.0100.05320.56
5.6.160.0130.07720.50
5.6.150.0070.03718.19
5.6.140.0070.04718.17
5.6.130.0070.07718.13
5.6.120.0030.07721.13
5.6.110.0100.07721.04
5.6.100.0070.07721.08
5.6.90.0130.03721.00
5.6.80.0070.08020.46
5.6.70.0230.04020.43
5.5.350.0030.05320.46
5.5.340.0100.08017.98
5.5.330.0030.09020.21
5.5.320.0230.07720.36
5.5.310.0330.06320.38
5.5.300.0070.08018.02
5.5.290.0200.04018.00
5.5.280.0100.07020.72
5.5.270.0070.07720.77
5.5.260.0030.06320.71
5.5.250.0070.08720.53
5.5.240.0070.07720.20
5.4.450.0770.06319.17
5.4.440.0600.06319.21
5.4.430.0230.04719.16
5.4.420.0800.05319.46
5.4.410.0830.05319.42
5.4.400.0500.06318.78
5.4.390.0400.06318.64
5.4.380.0200.05318.79
5.4.370.0230.04318.79
5.4.360.0170.05018.78
5.4.350.0090.03312.08
5.4.340.0140.03412.07
5.4.320.0060.03612.56
5.4.310.0050.04512.55
5.4.300.0040.04012.55
5.4.290.0080.03612.55
5.4.280.0050.04712.45
5.4.270.0090.04812.45
5.4.260.0070.04112.45
5.4.250.0170.04718.77
5.4.240.0000.06318.65
5.4.230.0100.07719.09
5.4.220.0100.08018.79
5.4.210.0070.06318.65
5.4.200.0070.05719.09
5.4.190.0230.05019.00
5.4.180.0100.07718.79
5.4.170.0070.05719.03
5.4.160.0030.08318.82
5.4.150.0030.07018.89
5.4.140.0130.07316.38
5.4.130.0070.05016.61
5.4.120.0100.06716.64
5.4.110.0030.05316.68
5.4.100.0070.05316.42
5.4.90.0000.05316.55
5.4.80.0070.05316.53
5.4.70.0030.05316.59
5.4.60.0100.05016.65
5.4.50.0030.05716.50
5.4.40.0070.05316.65
5.4.30.0070.04716.53
5.4.20.0000.05716.68
5.4.10.0170.06016.54
5.4.00.0130.04716.08
5.3.290.0040.04712.80
5.3.280.0130.06714.47
5.3.270.0100.05714.70
5.3.260.0130.05314.73
5.3.250.0030.05714.48
5.3.240.0030.05714.49
5.3.230.0030.07014.71
5.3.220.0070.05014.68
5.3.210.0100.05014.84
5.3.200.0030.05314.69
5.3.190.0030.05714.52
5.3.180.0170.04714.59
5.3.170.0100.05314.68
5.3.160.0100.05014.58
5.3.150.0100.04714.75
5.3.140.0170.06014.63
5.3.130.0030.06314.58
5.3.120.0070.05714.68
5.3.110.0170.07014.77
5.3.100.0100.05714.06
5.3.90.0170.04014.16
5.3.80.0070.05314.03
5.3.70.0070.05314.23
5.3.60.0130.05014.14
5.3.50.0070.07013.96
5.3.40.0070.05014.00
5.3.30.0070.05014.13
5.3.20.0130.06313.71
5.3.10.0100.05013.79
5.3.00.0130.04313.52
5.2.170.0070.04011.15
5.2.160.0100.05311.12
5.2.150.0030.06011.32
5.2.140.0100.04011.15
5.2.130.0030.04311.11
5.2.120.0100.04011.11
5.2.110.0100.04711.18
5.2.100.0000.06311.18
5.2.90.0030.04010.93
5.2.80.0030.04311.09
5.2.70.0070.04011.18
5.2.60.0030.04011.12
5.2.50.0170.03711.19
5.2.40.0030.04011.07
5.2.30.0070.04010.98
5.2.20.0030.05011.18
5.2.10.0000.05710.82
5.2.00.0070.03710.73
5.1.60.0030.0339.98
5.1.50.0000.03710.16
5.1.40.0030.03710.05
5.1.30.0030.03710.41
5.1.20.0070.03710.53
5.1.10.0070.03310.17
5.1.00.0030.05310.08
5.0.50.0000.0408.48
5.0.40.0030.0408.33
5.0.30.0100.0378.22
5.0.20.0100.0238.14
5.0.10.0130.0278.33
5.0.00.0130.0478.34
4.4.90.0000.0237.57
4.4.80.0070.0177.57
4.4.70.0030.0237.57
4.4.60.0030.0237.57
4.4.50.0030.0207.57
4.4.40.0000.0377.57
4.4.30.0000.0307.57
4.4.20.0100.0137.57
4.4.10.0000.0237.57
4.4.00.0070.0307.57
4.3.110.0070.0277.57
4.3.100.0070.0207.57
4.3.90.0100.0137.57
4.3.80.0030.0337.58
4.3.70.0000.0237.58
4.3.60.0030.0207.58
4.3.50.0000.0237.58
4.3.40.0000.0477.58
4.3.30.0000.0237.58
4.3.20.0030.0237.58
4.3.10.0030.0207.58
4.3.00.0100.0276.22

preferences:
35.3 ms | 401 KiB | 5 Q