3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Animal { protected $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 static function adopt(string $name): Animal; } class CatShelter implements AnimalShelter { public static function adopt(string $name): Cat { return new Cat($name); } } class DogShelter implements AnimalShelter { public static function adopt(string $name): Dog { return new Dog($name); } } $kitty = CatShelter::adopt("Ricky"); $kitty->speak(); echo "\n"; $doggy = 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.4.120.0100.01020.81
8.4.110.0100.01018.78
8.4.100.0100.00717.85
8.4.90.0040.00420.58
8.4.80.0050.00618.87
8.4.70.0070.00220.52
8.4.60.0120.00822.20
8.4.50.0130.00818.89
8.4.40.0090.00019.23
8.4.30.0080.01220.43
8.4.20.0110.00419.70
8.4.10.0080.01119.38
8.3.250.0110.00519.04
8.3.240.0130.00616.64
8.3.230.0100.00916.57
8.3.220.0060.00320.72
8.3.210.0050.00316.65
8.3.200.0020.00716.48
8.3.190.0030.00517.07
8.3.180.0110.00819.16
8.3.170.0100.00717.16
8.3.160.0060.00618.84
8.3.150.0040.01416.79
8.3.140.0090.00916.69
8.3.130.0050.00216.26
8.3.120.0150.00318.99
8.3.110.0030.00620.94
8.3.100.0050.00524.06
8.3.90.0040.00426.77
8.3.80.0000.00919.36
8.3.70.0140.00716.50
8.3.60.0100.00718.30
8.3.50.0120.00923.63
8.3.40.0090.00618.82
8.3.30.0080.00818.73
8.3.20.0080.00021.86
8.3.10.0040.00420.34
8.3.00.0040.00423.55
8.2.290.0100.00917.14
8.2.280.0020.00620.09
8.2.270.0040.00416.72
8.2.260.0070.01117.11
8.2.250.0030.00616.63
8.2.240.0110.00718.88
8.2.230.0040.00422.58
8.2.220.0140.00737.54
8.2.210.0030.00726.77
8.2.200.0030.00618.88
8.2.190.0070.01016.58
8.2.180.0090.00616.38
8.2.170.0070.00722.96
8.2.160.0070.00720.43
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0050.00326.16
8.2.110.0060.00320.94
8.2.100.0090.00317.91
8.2.90.0080.00017.84
8.2.80.0000.00818.05
8.2.70.0040.00817.63
8.2.60.0040.00417.38
8.2.50.0040.00417.98
8.2.40.0050.00318.16
8.2.30.0000.00718.06
8.2.20.0020.00518.06
8.2.10.0040.00419.13
8.2.00.0070.00019.13
8.1.330.0140.00616.30
8.1.320.0100.00817.90
8.1.310.0070.00716.88
8.1.300.0040.00417.82
8.1.290.0060.00330.84
8.1.280.0110.00325.92
8.1.270.0030.00620.75
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0110.00020.94
8.1.230.0090.00320.89
8.1.220.0050.00317.77
8.1.210.0060.00318.82
8.1.200.0030.00617.25
8.1.190.0030.00517.22
8.1.180.0070.00318.10
8.1.170.0080.00017.62
8.1.160.0050.00220.58
8.1.150.0000.00718.77
8.1.140.0040.00422.06
8.1.130.0000.00820.05
8.1.120.0050.00317.37
8.1.110.0040.00417.44
8.1.100.0070.00017.49
8.1.90.0040.00417.45
8.1.80.0000.00717.52
8.1.70.0000.00817.45
8.1.60.0040.00417.63
8.1.50.0040.00417.43
8.1.40.0050.00317.49
8.1.30.0000.00817.71
8.1.20.0000.00817.52
8.1.10.0040.00417.49
8.1.00.0030.00617.63
8.0.300.0000.00819.72
8.0.290.0040.00416.75
8.0.280.0030.00318.34
8.0.270.0070.00017.94
8.0.260.0030.00320.08
8.0.250.0030.00316.88
8.0.240.0100.00016.86
8.0.230.0000.00817.01
8.0.220.0030.00316.87
8.0.210.0030.00316.89
8.0.200.0000.00716.94
8.0.190.0000.00716.90
8.0.180.0030.00516.89
8.0.170.0000.00816.98
8.0.160.0040.00416.88
8.0.150.0000.00716.71
8.0.140.0040.00416.87
8.0.130.0030.00313.31
8.0.120.0040.00416.76
8.0.110.0050.00316.72
8.0.100.0000.00816.73
8.0.90.0000.00816.94
8.0.80.0030.01216.88
8.0.70.0020.00516.88
8.0.60.0000.00816.78
8.0.50.0000.00716.90
8.0.30.0060.01016.92
8.0.20.0140.00317.13
8.0.10.0000.00717.00
8.0.00.0150.00716.56
7.4.330.0050.00015.55
7.4.320.0030.00316.43
7.4.300.0060.00016.50
7.4.290.0000.00716.50
7.4.280.0000.00816.50
7.4.270.0060.00016.60
7.4.260.0060.00013.21
7.4.250.0000.00716.57
7.4.240.0020.00616.53
7.4.230.0070.00016.50
7.4.220.0000.00716.42
7.4.210.0100.00616.61
7.4.200.0000.00716.70
7.4.140.0130.01017.86
7.4.130.0150.00316.48
7.4.120.0170.00316.61
7.4.110.0160.00816.67
7.4.100.0140.00716.41
7.4.90.0120.00416.66
7.4.80.0070.01019.39
7.4.70.0030.01416.46
7.4.60.0100.00616.48
7.4.50.0070.01016.33
7.4.40.0130.00316.56
7.4.00.0050.00914.88
7.3.330.0040.00416.07
7.3.320.0000.00513.11
7.3.310.0030.00316.24
7.3.300.0040.00416.31
7.3.290.0080.00716.23
7.3.280.0060.00916.19
7.3.260.0140.01016.38
7.3.240.0110.00716.31
7.3.230.0230.02116.29
7.3.210.0090.00616.20
7.3.200.0060.00916.17
7.3.190.0110.00616.27
7.3.180.0100.01316.25
7.3.170.0120.00416.35
7.3.160.0060.01016.44
7.3.120.0000.01314.49
7.3.110.0130.00414.30
7.3.100.0040.00914.48
7.3.90.0140.00314.34
7.3.80.0130.00714.59
7.3.70.0170.00314.39
7.3.60.0060.00914.01
7.3.50.0000.01514.80
7.3.40.0000.01314.50
7.3.30.0070.00714.74
7.3.20.0070.00716.68
7.3.10.0070.01116.58
7.3.00.0030.01516.68
7.2.330.0060.01016.47
7.2.320.0030.01316.32
7.2.310.0040.01216.53
7.2.300.0040.01816.37
7.2.290.0060.01316.55
7.2.250.0090.00614.70
7.2.240.0160.00414.45
7.2.230.0060.00814.54
7.2.220.0060.01214.83
7.2.210.0150.00014.18
7.2.200.0060.00914.38
7.2.190.0060.01014.64
7.2.180.0060.00914.71
7.2.170.0100.00315.03
7.2.160.0030.01214.74
7.2.150.0090.00916.75
7.2.140.0060.00916.68
7.2.130.0070.00716.66
7.2.120.0090.00616.38
7.2.110.0030.01216.62
7.2.100.0080.01116.92
7.2.90.0080.00816.60
7.2.80.0040.01116.35
7.2.70.0060.00816.35
7.2.60.0000.01516.40
7.2.50.0090.00616.27
7.2.40.0110.00416.18
7.2.30.0000.01516.28
7.2.20.0040.01116.08
7.2.10.0030.01216.23
7.2.00.0120.00316.21

preferences:
28.46 ms | 403 KiB | 5 Q