3v4l.org

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

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.44417.19
7.1.60.0170.48019.82
7.1.50.0100.49217.04
7.1.00.0000.49022.57
7.0.200.0030.58616.67
7.0.140.0070.50022.01
7.0.60.0200.64319.82
7.0.50.0170.60317.90
7.0.40.0070.63720.09
7.0.30.0230.57320.24
7.0.20.0300.63720.19
7.0.10.0100.63720.23
7.0.00.0100.65320.09
5.6.210.0101.09320.48
5.6.200.0071.05318.12
5.6.190.0100.99720.61
5.6.180.0470.96320.51
5.6.170.0371.06020.55
5.6.160.0071.12320.43
5.6.150.0101.02318.15
5.6.140.0131.06318.11
5.6.130.0101.09018.27
5.6.120.0071.08021.13
5.6.110.0201.07021.12
5.6.100.0101.07021.02
5.6.90.0131.09720.89
5.6.80.0001.02320.39
5.5.350.0131.06020.34
5.5.340.0131.10017.97
5.5.330.0070.97320.43
5.5.320.0401.03720.32
5.5.310.0231.12720.34
5.5.300.0001.03317.98
5.5.290.0131.08718.07
5.5.280.0071.08320.88
5.5.270.0071.02020.97
5.5.260.0071.17720.88
5.5.250.0071.24020.68
5.5.240.0001.06320.05
5.4.450.0531.52319.19
5.4.440.0631.43719.51
5.4.430.0031.37019.64
5.4.420.0171.34019.46
5.4.410.0171.54318.69
5.4.400.0801.58018.76
5.4.390.0101.57018.73
5.4.380.0301.39718.61
5.4.370.0101.11018.75
5.4.360.0171.57018.74
5.4.350.0041.10112.03
5.4.340.0241.13112.02
5.4.320.0061.10212.51
5.4.310.0081.04412.51
5.4.300.0071.09212.50
5.4.290.0041.15212.50
5.4.280.0091.11012.40
5.4.270.0101.82318.78
5.4.260.0231.76018.84
5.4.250.0201.67418.85
5.4.240.0132.05018.72
5.4.230.0132.09018.93
5.4.220.0172.43018.82
5.4.210.0201.60018.84
5.4.200.0031.98318.89
5.4.190.0101.74018.79
5.4.180.0231.41018.91
5.4.170.0071.82718.92
5.4.160.0172.06018.71
5.4.150.0301.82718.88
5.4.140.0132.22016.43
5.4.130.0131.71016.41
5.4.120.0132.40316.39
5.4.110.0272.35716.36
5.4.100.0202.29016.43
5.4.90.0232.29016.66
5.4.80.0271.95716.46
5.4.70.0171.80716.42
5.4.60.0101.84716.47
5.4.50.0271.48016.36
5.4.40.0171.93016.38
5.4.30.0271.94316.34
5.4.20.0401.86316.33
5.4.10.0331.93316.34
5.4.00.0300.54315.92
5.3.290.0111.18512.80
5.3.280.0172.40314.60
5.3.270.0172.42714.45
5.3.260.0191.82914.66
5.3.250.0132.13014.58
5.3.240.0032.27314.61
5.3.230.0172.40014.58
5.3.220.0102.43314.31
5.3.210.0102.27314.73
5.3.200.0232.19714.54
5.3.190.0272.19014.23
5.3.180.0302.27314.55
5.3.170.0372.38314.38
5.3.160.0202.26314.34
5.3.150.0172.13714.63
5.3.140.0172.30714.64
5.3.130.0032.27714.51
5.3.120.0302.04314.40
5.3.110.0232.13014.40
5.3.100.0372.24013.79
5.3.90.0272.30713.86
5.3.80.0132.42313.79
5.3.70.0072.12014.01
5.3.60.0172.38313.87
5.3.50.0102.43313.73
5.3.40.0332.15314.02
5.3.30.0202.08713.71
5.3.20.0501.83313.57
5.3.10.1071.85313.52
5.3.00.0572.01713.39
5.2.170.0202.34010.95
5.2.160.0072.36311.08
5.2.150.0302.36711.08
5.2.140.0331.76711.08
5.2.130.0401.97710.84
5.2.120.0332.17010.86
5.2.110.0501.93710.84
5.2.100.0771.85710.79
5.2.90.0432.02010.94
5.2.80.0122.44610.85
5.2.70.0801.76710.82
5.2.60.0472.03310.81
5.2.50.0472.05010.84
5.2.40.0102.14010.59
5.2.30.0032.27010.89
5.2.20.0201.93711.13
5.2.10.0102.10010.75
5.2.00.0331.97010.68
5.1.60.0202.3109.77
5.1.50.0232.01310.22
5.1.40.0172.0309.94
5.1.30.0201.85310.20
5.1.20.0272.23310.31
5.1.10.0172.12710.04
5.1.00.0332.06010.13
5.0.50.0172.4138.36
5.0.40.0102.4578.18
5.0.30.0102.4578.08
5.0.20.0132.4007.96
5.0.10.0072.3907.89
5.0.00.0102.4337.88
4.4.90.0070.0206.83
4.4.80.0030.0336.83
4.4.70.0100.0176.83
4.4.60.0100.0176.83
4.4.50.0100.0236.83
4.4.40.0070.0436.83
4.4.30.0130.0136.83
4.4.20.0070.0206.83
4.4.10.0000.0306.83
4.4.00.0030.0336.83
4.3.110.0070.0206.83
4.3.100.0070.0276.83
4.3.90.0100.0276.83
4.3.80.0030.0436.83
4.3.70.0000.0236.83
4.3.60.0100.0206.83
4.3.50.0030.0306.83
4.3.40.0000.0376.83
4.3.30.0000.0336.83
4.3.20.0030.0236.83
4.3.10.0000.0236.83
4.3.00.0100.0206.99

preferences:
40.85 ms | 400 KiB | 5 Q