3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* class Pont { } $towerBridge = new Pont; $towerBridge->__construct(12.2, 43.1); */ class Player { private int $level; private Weapon $weapon; public function __construct(int $level) { $this->level = $level; } public function getLevel(): int { return $this->level; } public function setLevel(int $level) : void { $this->level = $level; } public function getWeapon(): Weapon { return $this->weapon; } public function setWeapon(Weapon $weapon) : void { $this->weapon = $weapon; } } class Weapon { private string $name; private int $attack; public function __construct(string $name, int $attack) { $this->name = $name; $this->attack = $attack; } public function getName(): string { return $this->name; } public function setName(string $name) : void { $this->name = $name; } public function getAttack(): int { return $this->attack; } public function setAttack(int $attack) : void { $this->attack = $attack; } } $masterSword = new Weapon("Master Sword", 1000); $link = new Player(4); $link->setWeapon($masterSword); echo "Link est de niveau ".$link->getLevel()."et il possède la ".$link->getWeapon()->name;

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.0070.01118.55
8.3.50.0070.00718.27
8.3.40.0100.00321.94
8.3.30.0150.00018.82
8.3.20.0040.00424.18
8.3.10.0030.00624.66
8.3.00.0060.00326.16
8.2.180.0140.00425.92
8.2.170.0180.00418.76
8.2.160.0030.01222.96
8.2.150.0030.00525.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.39
8.2.110.0060.00321.05
8.2.100.0080.00417.78
8.2.90.0060.00317.75
8.2.80.0000.00817.97
8.2.70.0090.00017.63
8.2.60.0080.00017.93
8.2.50.0030.00618.07
8.2.40.0000.00819.95
8.2.30.0040.00418.14
8.2.20.0040.00417.97
8.2.10.0000.00820.51
8.2.00.0060.00319.32
8.1.280.0070.01025.92
8.1.270.0020.00523.99
8.1.260.0000.01026.35
8.1.250.0030.00728.09
8.1.240.0000.01217.35
8.1.230.0090.00317.82
8.1.220.0060.00317.79
8.1.210.0040.00418.77
8.1.200.0100.00017.23
8.1.190.0030.00517.35
8.1.180.0050.00318.75
8.1.170.0060.00318.81
8.1.160.0040.00419.02
8.1.150.0030.00518.66
8.1.140.0060.00319.02
8.1.130.0000.00818.90
8.1.120.0040.00417.47
8.1.110.0040.00417.45
8.1.100.0040.00417.36
8.1.90.0000.00817.51
8.1.80.0000.00817.49
8.1.70.0050.00317.39
8.1.60.0000.00817.51
8.1.50.0000.00817.53
8.1.40.0050.00317.49
8.1.30.0040.00417.52
8.1.20.0060.00417.66
8.1.10.0120.00017.56
8.1.00.0040.00717.50
8.0.300.0000.00718.77
8.0.290.0000.00716.88
8.0.280.0030.00318.37
8.0.270.0070.00018.09
8.0.260.0030.00318.64
8.0.250.0030.00617.09
8.0.240.0000.00717.04
8.0.230.0040.00416.93
8.0.220.0030.00416.99
8.0.210.0030.00616.86
8.0.200.0000.00717.07
8.0.190.0060.00317.02
8.0.180.0000.00716.92
8.0.170.0060.00317.01
8.0.160.0070.00017.02
8.0.150.0060.00316.84
8.0.140.0030.00516.86
8.0.130.0060.00215.14
8.0.120.0010.00816.97
8.0.110.0030.00616.80
8.0.100.0040.00616.98
8.0.90.0040.00516.92
8.0.80.0050.00316.83
8.0.70.0030.00616.91
8.0.60.0060.00416.83
8.0.50.0020.00816.74
8.0.30.0050.00416.83
8.0.20.0020.00516.83
8.0.10.0040.00416.97
8.0.00.0080.00216.97
7.4.330.0050.00015.55
7.4.320.0060.00016.54
7.4.300.0030.00316.59
7.4.290.0050.00316.49
7.4.280.0040.00416.41
7.4.270.0060.00216.56
7.4.260.0040.00314.89
7.4.250.0070.00016.52
7.4.240.0050.00316.59
7.4.230.0050.00216.50
7.4.220.0030.00316.54
7.4.210.0020.00616.47
7.4.200.0000.00716.57
7.4.190.0020.00616.66
7.4.180.0050.00216.49
7.4.160.0020.00516.56
7.4.150.0020.00516.57
7.4.140.0040.00316.36
7.4.130.0000.00716.52
7.4.120.0050.00216.49
7.4.110.0050.00216.49
7.4.100.0050.00216.53
7.4.90.0010.00616.40
7.4.80.0060.00216.41
7.4.70.0060.00216.52
7.4.60.0070.00116.35
7.4.50.0060.00116.33
7.4.40.0020.00516.45
7.4.30.0050.00216.53
7.4.20.0020.00516.39
7.4.10.0060.00216.29
7.4.00.0070.00016.58
7.3.330.0110.00416.21
7.3.320.0130.00414.50
7.3.310.0160.00216.11
7.3.300.0140.00216.07
7.3.290.0100.00416.09
7.3.280.0070.00616.09
7.3.270.0060.00616.14
7.3.260.0060.00616.10
7.3.250.0070.00616.16
7.3.240.0100.00216.14
7.3.230.0090.00416.10
7.3.220.0080.00616.10
7.3.210.0110.00316.16
7.3.200.0140.00015.98
7.3.190.0110.00416.12
7.3.180.0080.00516.15
7.3.170.0090.00316.01
7.3.160.0120.00116.01
7.3.150.0100.00316.04
7.3.140.0110.00216.19
7.3.130.0110.00316.10
7.3.120.0070.00516.16
7.3.110.0080.00515.96
7.3.100.0080.00515.95
7.3.90.0080.00516.30
7.3.80.0090.00416.15
7.3.70.0050.00816.25
7.3.60.0060.00616.21
7.3.50.0110.00216.16
7.3.40.0080.00416.29
7.3.30.0110.00216.29
7.3.20.0120.00217.08
7.3.10.0150.00017.00
7.3.00.0100.00516.97

preferences:
49.88 ms | 401 KiB | 5 Q