3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Food {} class AnimalFood extends Food {} abstract class Animal { protected string $name; public function __construct(string $name) { $this->name = $name; } public function eat(AnimalFood $food) { echo $this->name . " eats " . get_class($food); } } class Dog extends Animal { public function eat(Food $food) { echo $this->name . " eats " . get_class($food); } } $kitty = (new CatShelter)->adopt("Ricky"); $catFood = new AnimalFood(); $kitty->eat($catFood); echo "\n"; $doggy = (new DogShelter)->adopt("Mavrick"); $banana = new Food(); $doggy->eat($banana);

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.0120.00616.50
8.3.50.0110.00418.04
8.3.40.0090.00618.96
8.3.30.0100.00318.98
8.3.20.0040.00424.18
8.3.10.0030.00624.66
8.3.00.0080.00026.16
8.2.180.0100.00725.92
8.2.170.0070.01122.96
8.2.160.0170.00322.96
8.2.150.0080.00025.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00826.35
8.2.110.0000.00920.89
8.2.100.0080.00717.59
8.2.90.0080.00017.75
8.2.80.0000.00818.82
8.2.70.0040.00417.63
8.2.60.0030.00617.63
8.2.50.0040.00418.05
8.2.40.0050.00319.63
8.2.30.0040.00417.91
8.2.20.0050.00217.98
8.2.10.0030.00519.05
8.2.00.0040.00419.24
8.1.280.0070.00725.92
8.1.270.0080.00023.99
8.1.260.0000.00728.09
8.1.250.0080.00028.09
8.1.240.0100.00019.44
8.1.230.0070.00320.97
8.1.220.0060.00318.46
8.1.210.0000.00818.77
8.1.200.0040.00417.30
8.1.190.0090.00017.23
8.1.180.0000.00918.10
8.1.170.0040.00418.87
8.1.160.0020.00518.73
8.1.150.0070.00018.78
8.1.140.0000.00818.75
8.1.130.0000.00820.05
8.1.120.0000.00717.32
8.1.110.0030.00617.36
8.1.100.0070.00017.27
8.1.90.0030.00517.37
8.1.80.0080.00017.24
8.1.70.0040.00417.30
8.1.60.0040.00417.39
8.1.50.0030.00517.48
8.1.40.0000.00917.46
8.1.30.0030.00517.61
8.1.20.0040.00417.60
8.1.10.0050.00517.43
8.1.00.0060.00617.29
8.0.300.0070.00018.77
8.0.290.0000.00816.63
8.0.280.0040.00418.30
8.0.270.0040.00418.02
8.0.260.0070.00020.23
8.0.250.0030.00316.95
8.0.240.0030.00316.96
8.0.230.0050.00316.98
8.0.220.0000.00716.96
8.0.210.0000.00716.79
8.0.200.0000.00716.87
8.0.190.0040.00417.00
8.0.180.0030.00516.83
8.0.170.0040.00416.80
8.0.160.0070.00016.92
8.0.150.0050.00316.75
8.0.140.0040.00516.78
8.0.130.0030.00515.03
8.0.120.0090.00116.77
8.0.110.0050.00716.79
8.0.100.0120.00016.92
8.0.90.0120.00116.80
8.0.80.0090.00716.86
8.0.70.0070.00716.83
8.0.60.0110.00316.81
8.0.50.0070.00716.75
8.0.30.0040.01516.90
8.0.20.0080.01017.05
8.0.10.0020.00616.81
8.0.00.0130.00216.83
7.4.330.0050.00015.55
7.4.320.0060.00016.51
7.4.300.0000.00616.40
7.4.290.0040.00416.55
7.4.280.0080.00016.57
7.4.270.0000.00816.41
7.4.260.0030.00514.85
7.4.250.0140.00116.49
7.4.240.0070.00516.52
7.4.230.0110.00316.53
7.4.220.0070.00416.49
7.4.210.0080.01016.49
7.4.200.0090.00316.50
7.4.190.0130.00616.43
7.4.180.0110.00716.40
7.4.160.0120.00816.59
7.4.150.0160.00316.41
7.4.140.0200.00016.34
7.4.130.0150.00716.46
7.4.120.0200.00616.42
7.4.110.0170.00416.40
7.4.100.0120.00816.53
7.4.90.0100.00916.43
7.4.80.0100.00917.93
7.4.70.0090.00916.39
7.4.60.0150.00416.34
7.4.50.0090.01116.20
7.4.40.0140.00316.33
7.4.30.0140.00416.33
7.4.20.0100.00916.32
7.4.10.0160.00216.35
7.4.00.0130.00516.45
7.3.330.0100.00316.14
7.3.320.0060.00614.59
7.3.310.0100.00416.25
7.3.300.0110.00216.09
7.3.290.0110.00516.12
7.3.280.0130.00416.02
7.3.270.0150.00416.02
7.3.260.0110.00916.19
7.3.250.0180.00316.21
7.3.240.0100.00816.18
7.3.230.0140.00816.12
7.3.220.0180.00016.10
7.3.210.0120.00516.11
7.3.200.0080.01016.10
7.3.190.0140.00816.12
7.3.180.0110.00616.05
7.3.170.0110.00716.01
7.3.160.0100.00816.05
7.3.150.0130.00716.16
7.3.140.0110.00716.11
7.3.130.0140.00616.26
7.3.120.0130.00416.12
7.3.110.0110.00716.14
7.3.100.0140.00816.05
7.3.90.0090.00816.25
7.3.80.0120.00616.01
7.3.70.0130.00416.15
7.3.60.0110.00716.13
7.3.50.0130.00516.20
7.3.40.0120.00616.15
7.3.30.0120.00516.06
7.3.20.0080.01117.15
7.3.10.0140.00517.13
7.3.00.0160.00317.00
7.2.340.0150.00416.17
7.2.330.0120.00716.18
7.2.320.0140.00316.36
7.2.310.0090.00916.19
7.2.300.0100.00816.10
7.2.290.0090.00916.03
7.2.280.0140.00516.00
7.2.270.0100.00916.29
7.2.260.0130.00616.14
7.2.250.0130.00516.30
7.2.240.0110.00816.32
7.2.230.0160.00516.16
7.2.220.0130.00616.04
7.2.210.0110.00616.13
7.2.200.0120.00716.24
7.2.190.0090.00916.20
7.2.180.0110.00716.31
7.2.170.0110.00716.14
7.2.160.0120.00916.29
7.2.150.0150.00517.20
7.2.140.0130.00617.22
7.2.130.0110.00717.27
7.2.120.0130.01017.31
7.2.110.0160.00517.35
7.2.100.0110.01217.17
7.2.90.0120.00717.20
7.2.80.0150.00417.21
7.2.70.0180.00217.38
7.2.60.0180.00217.18
7.2.50.0080.01117.15
7.2.40.0140.00517.31
7.2.30.0090.01117.23
7.2.20.0090.01017.25
7.2.10.0120.00717.23
7.2.00.0160.00417.15

preferences:
84.4 ms | 400 KiB | 5 Q