3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Animal { protected string $name; public function __construct(string $name) { $this->name = $name; } abstract public function speak(); } class Dog extends Animal { public function speak() { echo $this->name . " barks"; } } class Cat extends Animal { public function speak() { echo $this->name . " meows"; } } interface AnimalShelter { public function adopt(string $name): Animal; } class CatShelter implements AnimalShelter { public function adopt(string $name): Cat // instead of returning class type Animal, it can return class type Cat { return new Cat($name); } } class DogShelter implements AnimalShelter { public function adopt(string $name): Dog // instead of returning class type Animal, it can return class type Dog { return new Dog($name); } } $kitty = (new CatShelter)->adopt("Ricky"); $kitty->speak(); echo "\n"; $doggy = (new DogShelter)->adopt("Mavrick"); $doggy->speak();

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.5.30.0080.01017.74
8.5.20.0100.00719.64
8.5.10.0090.01216.75
8.5.00.0120.00919.96
8.4.180.0120.01021.95
8.4.170.0130.00821.82
8.4.160.0120.01123.77
8.4.150.0070.00616.93
8.4.140.0150.00617.55
8.4.130.0070.01318.36
8.4.120.0140.00519.54
8.4.110.0100.00519.59
8.4.100.0050.00517.86
8.4.90.0140.00720.72
8.4.80.0130.00718.95
8.4.70.0070.00118.99
8.4.60.0130.00817.84
8.4.50.0130.00820.52
8.4.40.0100.00718.73
8.4.30.0090.00618.63
8.4.20.0160.00320.46
8.4.10.0100.01019.51
8.3.300.0090.00218.56
8.3.290.0120.00920.72
8.3.280.0120.00718.34
8.3.270.0120.00816.48
8.3.260.0120.00816.41
8.3.250.0100.01016.79
8.3.240.0120.00816.61
8.3.230.0090.01016.59
8.3.220.0070.01118.64
8.3.210.0060.00316.77
8.3.200.0060.00216.75
8.3.190.0090.00917.29
8.3.180.0090.00716.59
8.3.170.0130.00616.54
8.3.160.0040.01417.42
8.3.150.0120.00619.10
8.3.140.0040.00417.24
8.3.130.0090.00018.34
8.3.120.0040.00420.91
8.3.110.0080.00016.53
8.3.100.0070.00316.91
8.3.90.0040.00418.29
8.3.80.0060.00318.43
8.3.70.0180.00016.50
8.3.60.0060.01318.30
8.3.50.0110.00824.55
8.3.40.0050.00820.48
8.3.30.0070.00718.44
8.3.20.0000.00721.95
8.3.10.0080.00022.09
8.3.00.0080.00020.37
8.2.300.0080.01222.29
8.2.290.0120.00516.54
8.2.280.0120.00916.50
8.2.270.0130.00716.92
8.2.260.0040.00416.90
8.2.250.0050.00318.93
8.2.240.0060.00316.42
8.2.230.0000.00920.94
8.2.220.0040.00424.06
8.2.210.0080.01126.77
8.2.200.0090.00018.16
8.2.190.0090.00616.63
8.2.180.0140.00718.29
8.2.170.0070.00722.96
8.2.160.0030.01019.36
8.2.150.0030.00524.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0050.00326.16
8.2.110.0030.00719.24
8.2.100.0130.00317.78
8.2.90.0050.00319.34
8.2.80.0000.00819.14
8.2.70.0030.00617.63
8.2.60.0050.00317.50
8.2.50.0040.00418.05
8.2.40.0050.00318.22
8.2.30.0010.00718.84
8.2.20.0040.00418.12
8.2.10.0000.00719.30
8.2.00.0000.00719.29
8.1.340.0100.01017.73
8.1.330.0100.00816.10
8.1.320.0100.00817.93
8.1.310.0070.01016.69
8.1.300.0080.00017.89
8.1.290.0060.00618.88
8.1.280.0100.00325.92
8.1.270.0040.01122.09
8.1.260.0030.00526.35
8.1.250.0070.00028.09
8.1.240.0000.00922.19
8.1.230.0130.00320.95
8.1.220.0030.00617.74
8.1.210.0000.00818.97
8.1.200.0000.00817.35
8.1.190.0030.00517.23
8.1.180.0060.00318.10
8.1.170.0000.00817.62
8.1.160.0020.00518.95
8.1.150.0000.00718.89
8.1.140.0030.00318.89
8.1.130.0040.00420.07
8.1.120.0000.00717.38
8.1.110.0040.00417.45
8.1.100.0070.00017.46
8.1.90.0030.00917.48
8.1.80.0060.00317.36
8.1.70.0000.00717.34
8.1.60.0080.00017.59
8.1.50.0000.00717.57
8.1.40.0040.00417.56
8.1.30.0000.00717.70
8.1.20.0000.00817.53
8.1.10.0090.00017.46
8.1.00.0140.00917.31
8.0.300.0000.00820.16
8.0.290.0070.00016.62
8.0.280.0030.00318.45
8.0.270.0000.00717.92
8.0.260.0070.00021.81
8.0.250.0060.00016.84
8.0.240.0000.00716.87
8.0.230.0070.00016.96
8.0.220.0000.00616.79
8.0.210.0030.00316.86
8.0.200.0000.00816.93
8.0.190.0050.00316.82
8.0.180.0000.00816.87
8.0.170.0060.00316.93
8.0.160.0050.00316.91
8.0.150.0000.00716.86
8.0.140.0000.00716.77
8.0.130.0000.00613.29
8.0.120.0040.00416.86
8.0.110.0070.00017.00
8.0.100.0040.00416.79
8.0.90.0000.00816.79
8.0.80.0090.00616.87
8.0.70.0040.00416.89
8.0.60.0050.00316.96
8.0.50.0040.00416.87
8.0.30.0060.00916.87
8.0.20.0120.00616.96
8.0.10.0140.00317.03
8.0.00.0090.00816.93
7.4.330.0030.00315.55
7.4.320.0060.00016.57
7.4.300.0000.00616.52
7.4.290.0030.00516.59
7.4.280.0050.00316.39
7.4.270.0030.00316.65
7.4.260.0030.00313.26
7.4.250.0040.00416.47
7.4.240.0030.00316.50
7.4.230.0030.00616.71
7.4.220.0020.00516.48
7.4.210.0060.00816.53
7.4.200.0000.00716.51
7.4.160.0070.00716.48
7.4.150.0120.00316.57
7.4.140.0090.00816.45
7.4.130.0100.01016.43
7.4.120.0100.00816.57
7.4.110.0080.00916.40
7.4.100.0110.00616.42
7.4.90.0080.01016.42
7.4.80.0090.01017.43
7.4.70.0090.01016.43
7.4.60.0120.00816.32
7.4.50.0130.00616.42
7.4.40.0080.00916.45
7.4.30.0060.01116.47
7.4.20.0120.00616.42
7.4.10.0120.00716.44
7.4.00.0090.00816.48
7.3.330.0000.00715.99
7.3.320.0020.00513.11
7.3.310.0000.00716.10
7.3.300.0040.00416.16
7.3.290.0130.00516.15
7.3.280.0070.00716.18
7.3.270.0040.01116.14
7.3.260.0090.00916.23
7.3.250.0120.00616.12
7.3.240.0120.00616.24
7.3.230.0110.00916.26
7.3.220.0080.00716.10
7.3.210.0080.00916.10
7.3.200.0070.00916.20
7.3.190.0120.00716.25
7.3.180.0080.00916.16
7.3.170.0120.00416.21
7.3.160.0100.00916.12
7.3.150.0080.00916.09
7.3.140.0080.00816.14
7.3.130.0070.00916.20
7.3.120.0080.00816.17
7.3.110.0070.00916.09
7.3.100.0100.00516.01
7.3.90.0080.01016.26
7.3.80.0100.00816.13
7.3.70.0070.00816.15
7.3.60.0090.00916.17
7.3.50.0130.00416.18
7.3.40.0110.00516.17
7.3.30.0050.01216.14
7.3.20.0130.00516.15
7.3.10.0090.00916.17
7.3.00.0120.00716.15
7.2.340.0200.00516.31
7.2.330.0170.00716.30
7.2.320.0190.01016.29
7.2.310.0140.00816.24
7.2.300.0150.01116.29
7.2.290.0140.01016.15
7.2.280.0150.01116.24
7.2.270.0140.01016.23
7.2.260.0110.01116.14
7.2.250.0090.01316.36
7.2.240.0160.00616.28
7.2.230.0170.00816.30
7.2.220.0150.00816.25
7.2.210.0160.00716.25
7.2.200.0140.01116.22
7.2.190.0160.00916.40
7.2.180.0110.01516.25
7.2.170.0160.01016.30
7.2.160.0140.00916.30
7.2.150.0170.00916.28
7.2.140.0170.00916.42
7.2.130.0170.00716.45
7.2.120.0150.00816.33
7.2.110.0180.00916.44
7.2.100.0130.01016.31
7.2.90.0500.01116.34
7.2.80.0170.00916.32
7.2.70.0150.01116.31
7.2.60.0170.00516.32
7.2.50.0190.00716.34
7.2.40.0170.00616.34
7.2.30.0170.00916.38
7.2.20.0180.00616.39
7.2.10.0120.01216.33
7.2.00.0150.00916.34

preferences:
63.94 ms | 1531 KiB | 5 Q