3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Server { private $hostname; private $cpu; private $ram; public function __construct($hostname, $cpu, $ram) { $this->hostname = $hostname; $this->cpu = $cpu; $this->ram = $ram; } public function getHostname() { return $this->hostname; } public function setHostname($hostname) { return $this->hostname = ($hostname == null ? $this->_exception("Hostname must not be null.") : $hostname); } public function getCpu() { return $this->cpu; } public function setCpu($cpu) { return $this->cpu = ($cpu == null ? $this->_exception("CPU must not be null.") : $cpu); } public function getRam() { return $this->ram; } public function setRam($ram) { return $this->ram = ($ram == null ? $this->_exception("RAM must not be null.") : $ram); } public function getRamInGb() { return $this->ram / 1024; } public function addRam($ram) { return $this->ram = ($ram === null ? $this->_exception("RAM must not be null.") : $this->ram + $ram); } public function subRam($ram) { return $this->ram = ($this->ram - $ram < 0 ? $this->_exception("RAM must not result in a below-zero value.") : $this->ram - $ram); } protected function _exception($text = null) { throw new InvalidArgumentException($text); } }

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)
8.3.60.0080.00616.63
8.3.50.0130.00621.93
8.3.40.0110.01118.57
8.3.30.0040.01118.54
8.3.20.0050.00220.29
8.3.10.0050.00323.65
8.3.00.0000.00819.85
8.2.180.0070.01418.04
8.2.170.0110.00722.96
8.2.160.0030.01020.34
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0080.00019.25
8.2.120.0040.00426.35
8.2.110.0100.01020.56
8.2.100.0040.00817.80
8.2.90.0040.00419.05
8.2.80.0030.00517.97
8.2.70.0030.00717.34
8.2.60.0040.00417.68
8.2.50.0030.00618.07
8.2.40.0030.00522.34
8.2.30.0000.00720.56
8.2.20.0000.00717.66
8.2.10.0050.00317.97
8.2.00.0050.00218.02
8.1.280.0100.00325.92
8.1.270.0150.00320.32
8.1.260.0030.00528.09
8.1.250.0080.00028.09
8.1.240.0090.00023.82
8.1.230.0090.00317.64
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0060.00317.23
8.1.190.0040.00417.13
8.1.180.0030.00518.10
8.1.170.0050.00318.46
8.1.160.0040.00420.58
8.1.150.0000.00718.71
8.1.140.0000.00919.50
8.1.130.0030.00317.67
8.1.120.0000.00717.43
8.1.110.0030.00317.36
8.1.100.0040.00417.34
8.1.90.0000.00817.42
8.1.80.0040.00417.25
8.1.70.0030.00317.37
8.1.60.0000.00817.48
8.1.50.0030.00617.38
8.1.40.0030.00517.32
8.1.30.0060.00317.55
8.1.20.0050.00317.60
8.1.10.0070.00017.38
8.1.00.0040.00417.32
8.0.300.0000.00818.77
8.0.290.0040.00416.58
8.0.280.0030.00318.40
8.0.270.0000.00717.18
8.0.260.0030.00317.16
8.0.250.0070.00016.91
8.0.240.0040.00416.70
8.0.230.0040.00416.70
8.0.220.0080.00016.78
8.0.210.0000.00716.78
8.0.200.0030.00316.90
8.0.190.0000.00816.79
8.0.180.0040.00416.81
8.0.170.0030.00616.74
8.0.160.0030.00316.84
8.0.150.0070.00016.73
8.0.140.0000.00716.60
8.0.130.0000.00513.19
8.0.120.0060.00316.75
8.0.110.0000.00816.79
8.0.100.0040.00416.82
8.0.90.0030.00516.87
8.0.80.0200.00716.74
8.0.70.0040.00416.68
8.0.60.0000.00816.76
8.0.50.0040.00416.83
8.0.30.0080.01117.02
8.0.20.0120.00717.40
8.0.10.0050.00216.91
8.0.00.0060.01216.69
7.4.330.0000.00516.77
7.4.320.0000.00716.31
7.4.300.0000.00616.56
7.4.290.0000.00916.44
7.4.280.0000.00916.51
7.4.270.0030.00316.44
7.4.260.0030.00716.35
7.4.250.0040.00416.55
7.4.240.0050.00216.44
7.4.230.0030.00516.31
7.4.220.0180.00616.44
7.4.210.0100.00316.46
7.4.200.0030.00316.16
7.4.160.0000.01516.34
7.4.150.0090.00917.40
7.4.140.0090.01217.86
7.4.130.0090.00916.30
7.4.120.0070.01316.39
7.4.110.0150.00316.39
7.4.100.0130.01016.43
7.4.90.0100.00616.34
7.4.80.0070.01119.39
7.4.70.0060.01016.61
7.4.60.0100.00916.43
7.4.50.0000.01516.56
7.4.40.0030.01416.54
7.4.30.0100.00716.22
7.4.00.0060.00614.74
7.3.330.0030.00313.07
7.3.320.0050.00013.20
7.3.310.0000.00716.23
7.3.300.0030.00316.16
7.3.290.0090.00716.19
7.3.280.0080.00916.21
7.3.270.0070.01117.40
7.3.260.0090.00916.32
7.3.250.0070.01516.32
7.3.240.0100.01016.31
7.3.230.0170.00016.40
7.3.210.0070.01616.27
7.3.200.0140.00316.13
7.3.190.0130.00916.13
7.3.180.0070.01016.47
7.3.170.0100.01316.46
7.3.160.0070.01016.32
7.2.330.0070.01016.35
7.2.320.0110.01416.48
7.2.310.0070.01016.58
7.2.300.0100.00616.62
7.2.290.0100.00716.54
7.2.00.0160.00319.27
7.1.100.0030.01017.51
7.1.70.0040.01117.00
7.1.60.0040.02119.13
7.1.50.0100.01616.95
7.1.00.0070.07322.30
7.0.200.0650.00314.25
7.0.60.0100.06019.91
7.0.50.0070.08017.87
7.0.40.0000.05320.20
7.0.30.0270.07720.24
7.0.20.0270.07720.22
7.0.10.0030.05320.15
7.0.00.0130.07020.11
5.6.280.0030.06321.04
5.6.210.0070.04320.71
5.6.200.0030.05318.13
5.6.190.0030.04320.64
5.6.180.0130.08020.33
5.6.170.0330.06020.47
5.6.160.0100.06720.46
5.6.150.0070.04718.15
5.6.140.0100.03318.18
5.6.130.0100.08318.18
5.6.120.0070.04020.98
5.6.110.0030.06020.99
5.6.100.0070.08321.14
5.6.90.0030.04721.09
5.6.80.0070.07320.35
5.5.350.0200.07720.48
5.5.340.0070.05718.00
5.5.330.0130.04320.28
5.5.320.0270.04020.35
5.5.310.0300.07320.34
5.5.300.0070.08018.01
5.5.290.0030.08318.01
5.5.280.0170.04320.89
5.5.270.0070.05020.78
5.5.260.0000.08320.89
5.5.250.0100.07320.80
5.5.240.0130.03020.35

preferences:
43.59 ms | 401 KiB | 5 Q