3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NonEmptySetter { public function __set($name, $value) { $this->{$name} = $value; } } class EmptySetter { public function __set($name, $value) {} } function benchmark($obj) { $start_time = microtime(TRUE); for ($i = 0; $i < 1000000; $i++) { $obj->foo = 42; } return microtime(TRUE) - $start_time; } printf("NonEmptySetter: %.2f seconds\n", benchmark(new NonEmptySetter)); printf("EmptySetter: %.2f seconds\n", benchmark(new 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.4.00.0100.08714.94
7.3.120.0080.15414.94
7.3.110.0070.15114.69
7.3.100.0070.09614.79
7.3.90.0080.11314.87
7.3.80.0020.11514.84
7.3.70.0020.08914.93
7.3.60.0020.09914.65
7.3.50.0030.10814.63
7.3.40.0020.11814.83
7.3.30.0050.13214.78
7.3.20.0080.09416.69
7.3.10.0050.11516.50
7.3.00.0050.09016.67
7.2.250.0080.13615.05
7.2.240.0070.13515.00
7.2.230.0020.10315.05
7.2.220.0030.10114.97
7.2.210.0080.15115.08
7.2.200.0050.10215.04
7.2.190.0080.14514.93
7.2.180.0050.12815.13
7.2.170.0020.10615.14
7.2.160.0100.11114.68
7.2.150.0130.12116.97
7.2.140.0030.10916.92
7.2.130.0030.09717.09
7.2.120.0100.10217.07
7.2.110.0000.09516.79
7.2.100.0030.10816.89
7.2.90.0070.10016.96
7.2.80.0030.10317.05
7.2.70.0000.16316.82
7.2.60.0100.10716.64
7.2.50.0100.12516.29
7.2.40.0000.18116.55
7.2.30.0030.09616.71
7.2.20.0070.13616.71
7.2.10.0070.12116.77
7.2.00.0030.09116.78
7.1.330.0020.16515.75
7.1.320.0080.16215.62
7.1.310.0050.18615.71
7.1.300.0080.21415.80
7.1.290.0030.16715.83
7.1.280.0050.16815.85
7.1.270.0030.19315.64
7.1.260.0070.18615.66
7.1.250.0070.15615.88
7.1.70.0030.11117.19
7.1.60.0100.13019.82
7.1.50.0170.14617.14
7.1.00.0000.21022.28
7.0.200.0160.13016.87
7.0.140.0030.21321.98
7.0.80.0430.19319.88
7.0.70.0430.18019.92
7.0.60.0530.20019.79
7.0.50.0630.19320.25
7.0.40.0070.19720.08
7.0.30.0130.19720.18
7.0.20.0100.20320.05
7.0.10.0170.19320.17
7.0.00.0130.18320.18
5.6.280.0070.38721.05
5.6.230.0070.32020.72
5.6.220.0270.33320.65
5.6.210.0070.37720.59
5.6.200.0070.31721.10
5.6.190.0170.35320.96
5.6.180.0070.31321.18
5.6.170.0070.29721.09
5.6.160.0030.31721.04
5.6.150.0030.36321.18
5.6.140.0130.36320.94
5.6.130.0070.33721.06
5.6.120.0070.32020.94
5.6.110.0070.37721.14
5.6.100.0000.30020.95
5.6.90.0070.34021.03
5.6.80.0170.35320.34
5.6.70.0030.31720.46
5.6.60.0470.25020.43
5.6.50.0130.37320.52
5.6.40.0030.39020.36
5.6.30.0030.34720.54
5.6.20.0300.29020.44
5.6.10.0070.34020.32
5.6.00.0000.33020.37
5.5.370.0000.31020.40
5.5.360.0070.29720.35
5.5.350.0070.30320.47
5.5.340.0100.34720.91
5.5.330.0070.36720.90
5.5.320.0070.37020.87
5.5.310.0100.29720.91
5.5.300.0070.34320.83
5.5.290.0000.29720.88
5.5.280.0230.33720.78
5.5.270.0100.34720.78
5.5.260.0030.32020.79
5.5.250.0100.36320.61
5.5.240.0000.34720.15
5.5.230.0070.33720.29
5.5.220.0070.31720.18
5.5.210.0000.27020.32
5.5.200.0070.26320.22
5.5.190.0070.29320.11
5.5.180.0130.35020.22
5.5.160.0030.32720.00
5.5.150.0100.28320.29
5.5.140.0070.36720.26
5.5.130.0130.25720.11
5.5.120.0070.25720.28
5.5.110.0070.30020.15
5.5.100.0200.24720.11
5.5.90.0130.24720.16
5.5.80.0030.25720.07
5.5.70.0070.28720.14
5.5.60.0100.29719.97
5.5.50.0070.29320.14
5.5.40.0000.29020.17
5.5.30.0070.29720.05
5.5.20.0030.30720.07
5.5.10.0070.39019.98
5.5.00.0100.29720.06
5.4.450.0030.35719.56
5.4.440.0070.30019.24
5.4.430.0030.35719.46
5.4.420.0070.28019.50
5.4.410.0330.30719.32
5.4.400.0130.33718.90
5.4.390.0000.32019.16
5.4.380.0030.28019.18
5.4.370.0130.36319.14
5.4.360.0100.30719.13
5.4.350.0070.32719.03
5.4.340.0030.32719.04
5.4.320.0000.33719.04
5.4.310.0030.33019.00
5.4.300.0070.28719.04
5.4.290.0070.32018.90
5.4.280.0070.36019.17
5.4.270.0030.35318.87
5.4.260.0030.25319.09
5.4.250.0000.25319.13
5.4.240.0330.23719.12
5.4.230.0130.36019.04
5.4.220.0100.31018.84
5.4.210.0070.34719.15
5.4.200.0000.26718.90
5.4.190.0100.32319.20
5.4.180.0100.28018.86
5.4.170.0130.34319.17
5.4.160.0100.28719.21
5.4.150.0070.34319.12
5.4.140.0030.28016.52
5.4.130.0000.26316.48
5.4.120.0170.24716.46
5.4.110.0030.27316.38
5.4.100.0000.29716.44
5.4.90.0230.23316.32
5.4.80.0030.22716.44
5.4.70.0070.27316.31
5.4.60.0000.27716.31
5.4.50.0030.31716.39
5.4.40.0000.32716.41
5.4.30.0070.33016.37
5.4.20.0030.22716.46
5.4.10.0070.28016.29
5.4.00.0100.33315.75
5.3.290.0000.38314.65
5.3.280.0100.45314.60
5.3.270.0070.46714.60
5.3.260.0130.44314.58
5.3.250.0100.40714.70
5.3.240.0030.37314.67
5.3.230.0100.43314.70
5.3.220.0030.37714.59
5.3.210.0000.36714.54
5.3.200.0070.32014.66
5.3.190.0100.34714.64
5.3.180.0070.35314.68
5.3.170.0070.32014.55
5.3.160.0000.37314.69
5.3.150.0070.46014.58
5.3.140.0100.46714.56
5.3.130.0000.36014.47
5.3.120.0030.32714.47
5.3.110.0070.47714.58
5.3.100.0030.40014.09
5.3.90.0070.47313.96
5.3.80.0000.44314.09
5.3.70.0130.45714.04
5.3.60.0070.45314.12
5.3.50.0170.43314.05
5.3.40.0130.45713.97
5.3.30.0070.39013.98
5.3.20.0030.44313.76
5.3.10.0030.47013.72
5.3.00.0130.45313.65
5.2.170.0030.45711.88
5.2.160.0070.50011.88
5.2.150.0100.55011.88
5.2.140.0100.54011.88
5.2.130.0070.52311.88
5.2.120.0030.55011.88
5.2.110.0030.47011.88
5.2.100.0030.43011.88
5.2.90.0030.43711.88
5.2.80.0000.53311.88
5.2.70.0000.57311.88
5.2.60.0030.50711.88
5.2.50.0030.50011.88
5.2.40.0000.52711.88
5.2.30.0070.54711.88
5.2.20.0030.48311.88
5.2.10.0130.52711.88
5.2.00.0030.52711.88
5.1.60.0070.55311.88
5.1.50.0500.47011.88
5.1.40.0000.52311.88
5.1.30.0030.54311.88
5.1.20.0030.53311.88
5.1.10.0000.54011.88
5.1.00.0130.52011.88
5.0.50.0100.70711.88
5.0.40.0070.75311.88
5.0.30.0070.71311.88
5.0.20.0070.75011.88
5.0.10.0030.68311.88
5.0.00.0030.67711.88
4.4.90.0030.03711.88
4.4.80.0000.01711.88
4.4.70.0070.02311.88
4.4.60.0000.02711.88
4.4.50.0070.02711.88
4.4.40.0030.05311.88
4.4.30.0030.03311.88
4.4.20.0000.02311.88
4.4.10.0070.02711.88
4.4.00.0070.02011.88
4.3.110.0000.03311.88
4.3.100.0030.02711.88
4.3.90.0100.02711.88
4.3.80.0000.04311.88
4.3.70.0070.03011.88
4.3.60.0030.02711.88
4.3.50.0030.04011.88
4.3.40.0030.03311.88
4.3.30.0000.04011.88
4.3.20.0070.02011.88
4.3.10.0000.02011.88
4.3.00.0000.03311.88

preferences:
28.26 ms | 401 KiB | 5 Q