3v4l.org

run code in 300+ PHP versions simultaneously
<?php class EmptySetter { public $foo = NULL; public function __set($name, $value) {} } class NonEmptySetter { public function __set($name, $value) { $this->{$name} = $value; } } function benchmark($obj) { $start_time = microtime(TRUE); for ($i = 0; $i < 10000000; $i++) { $obj->foo = 42; } return microtime(TRUE) - $start_time; } printf("EmptySetter: %.2f seconds\n", benchmark(new EmptySetter)); printf("NonEmptySetter: %.2f seconds\n", benchmark(new NonEmptySetter));

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.1.70.0030.32417.16
7.1.60.0100.35319.82
7.1.50.0070.38317.15
7.1.00.0030.36022.45
7.0.200.0130.40316.58
7.0.140.0030.44322.12
7.0.60.0130.42019.77
7.0.50.0070.40017.80
7.0.40.0100.39320.22
7.0.30.0270.36320.13
7.0.20.0230.37720.20
7.0.10.0100.41020.23
7.0.00.0070.37320.23
5.6.280.0101.27721.11
5.6.210.0171.24020.67
5.6.200.0071.04318.18
5.6.190.0171.07720.63
5.6.180.3131.10320.77
5.6.170.0171.05320.45
5.6.160.0071.17020.56
5.6.150.0101.12718.14
5.6.140.0001.13018.15
5.6.130.0071.39718.28
5.6.120.0071.16021.04
5.6.110.0201.12021.15
5.6.100.0071.14320.98
5.6.90.0101.13321.11
5.6.80.0101.11320.36
5.6.70.4271.00020.33
5.5.350.0031.14320.45
5.5.340.0071.12317.98
5.5.330.0031.07020.57
5.5.320.0131.06020.28
5.5.310.0231.14020.27
5.5.300.0071.18718.07
5.5.290.0031.12718.08
5.5.280.0101.20320.89
5.5.270.0071.11020.77
5.5.260.0201.12720.90
5.5.250.0071.13320.79
5.5.240.0001.14720.08
5.4.450.0831.57019.47
5.4.440.0301.56319.20
5.4.430.0101.50719.31
5.4.420.0171.54719.39
5.4.410.0071.86319.08
5.4.400.0301.61718.84
5.4.390.0201.67718.60
5.4.380.0301.55018.48
5.4.370.0201.52318.48
5.4.360.0371.80718.69
5.4.350.0081.17412.02
5.4.340.0381.11412.02
5.4.320.0091.16612.50
5.4.310.0081.10712.50
5.4.300.0081.11712.50
5.4.290.0071.09712.50
5.4.280.0111.12812.41
5.4.270.0101.89318.71
5.4.260.0101.58018.71
5.4.250.0171.71018.67
5.4.240.0132.03018.85
5.4.230.0101.88318.84
5.4.220.0131.76018.85
5.4.210.0171.70018.83
5.4.200.0171.62018.94
5.4.190.0171.88718.77
5.4.180.0202.33718.76
5.4.170.0101.97318.85
5.4.160.0232.09718.93
5.4.150.0101.65018.52
5.4.140.0071.74016.33
5.4.130.0172.03016.46
5.4.120.0301.89016.41
5.4.110.0171.98016.34
5.4.100.0202.23316.52
5.4.90.0101.68016.48
5.4.80.0271.81716.35
5.4.70.0101.73016.34
5.4.60.0271.72716.28
5.4.50.0131.85316.59
5.4.40.0171.84316.41
5.4.30.0031.81716.38
5.4.20.0131.69016.45
5.4.10.0101.86316.36
5.4.00.0232.11715.83
5.3.290.0071.64912.80
5.3.280.0102.44314.62
5.3.270.0172.42014.41
5.3.260.0202.44014.75
5.3.250.0172.45314.50
5.3.240.0172.41714.43
5.3.230.0172.44314.30
5.3.220.0172.37314.32
5.3.210.0232.20314.49
5.3.200.0132.43014.47
5.3.190.0172.43714.49
5.3.180.0172.37014.39
5.3.170.0472.26014.23
5.3.160.0132.35314.41
5.3.150.0172.43014.53
5.3.140.0172.41714.47
5.3.130.0172.44014.56
5.3.120.0132.43014.28
5.3.110.0102.40714.47
5.3.100.0232.45713.84
5.3.90.0102.43713.77
5.3.80.0172.44313.59
5.3.70.0072.43313.79
5.3.60.0102.41313.84
5.3.50.0072.43713.55
5.3.40.0072.45313.81
5.3.30.0232.45013.83
5.3.20.0032.38713.60
5.3.10.0102.41013.57
5.3.00.0032.30713.59
5.2.170.0202.33011.08
5.2.160.0302.32710.98
5.2.150.0232.44310.88
5.2.140.0132.46310.98
5.2.130.0072.41010.68
5.2.120.0032.44710.81
5.2.110.0202.32710.85
5.2.100.0102.44310.88
5.2.90.0272.37710.92
5.2.80.0202.26010.98
5.2.70.0172.43010.88
5.2.60.0072.43010.98
5.2.50.0032.43010.75
5.2.40.0132.29710.83
5.2.30.0272.45310.73
5.2.20.0072.39010.75
5.2.10.0032.36310.66
5.2.00.0232.20310.63
5.1.60.0172.3509.82
5.1.50.0072.4409.86
5.1.40.0102.4509.89
5.1.30.0102.44010.23
5.1.20.0202.40010.16
5.1.10.0172.45310.00
5.1.00.0002.4639.96
5.0.50.0232.4138.39
5.0.40.0032.4608.30
5.0.30.0032.4507.96
5.0.20.0072.4438.11
5.0.10.0072.4508.00
5.0.00.0032.4808.05
4.4.90.0000.0236.46
4.4.80.0100.0176.46
4.4.70.0030.0236.46
4.4.60.0000.0236.46
4.4.50.0070.0206.46
4.4.40.0170.0236.46
4.4.30.0030.0236.46
4.4.20.0030.0276.46
4.4.10.0000.0236.46
4.4.00.0000.0476.46
4.3.110.0070.0236.46
4.3.100.0070.0276.46
4.3.90.0030.0206.46
4.3.80.0030.0336.46
4.3.70.0070.0236.46
4.3.60.0030.0206.46
4.3.50.0030.0306.46
4.3.40.0000.0436.44
4.3.30.0100.0236.42
4.3.20.0030.0306.41
4.3.10.0030.0206.40
4.3.00.0000.0276.89

preferences:
36.9 ms | 400 KiB | 5 Q