3v4l.org

run code in 500+ PHP versions simultaneously
<?php abstract class Car { abstract function objectify(); } class BMW extends Car { public function objectify() { return "I'm a BMW"; } } class Honda extends Car { public function objectify() { return "I'm a Honda"; } } class Tesla extends Car { public function objectify() { return "I'm a Tesla"; } } $carTypes = array("Germany" => "BMW", "Japan" => "Honda", "America" => "Tesla"); $country = "Germany"; //replace this with actual user input, in your version $car = new $carTypes[$country](); echo $car->objectify();

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.60.0130.00716.84
8.5.50.0040.00316.64
8.5.30.0090.00817.61
8.5.20.0100.01019.50
8.5.10.0100.00720.08
8.5.00.0130.00921.86
8.4.210.0120.00819.45
8.4.180.0120.01019.55
8.4.170.0130.00920.60
8.4.160.0110.01121.53
8.4.150.0060.00716.84
8.4.140.0080.01317.91
8.4.130.0110.00917.54
8.4.120.0120.01022.32
8.4.110.0100.00922.60
8.4.100.0050.00617.95
8.4.90.0110.01020.70
8.4.80.0120.00718.74
8.4.70.0090.00717.89
8.4.60.0080.01220.43
8.4.50.0100.01118.69
8.4.40.0090.00019.60
8.4.30.0100.01018.57
8.4.20.0100.00717.90
8.4.10.0090.00621.84
8.3.300.0120.00820.88
8.3.290.0110.00922.50
8.3.280.0120.00818.26
8.3.270.0140.00716.30
8.3.260.0100.00916.67
8.3.250.0140.00419.09
8.3.240.0090.01016.86
8.3.230.0110.00816.80
8.3.220.0080.00919.04
8.3.210.0050.00716.37
8.3.200.0060.00316.49
8.3.190.0080.00817.05
8.3.180.0090.01016.66
8.3.170.0100.00620.62
8.3.160.0110.00716.94
8.3.150.0070.01416.97
8.3.140.0120.00616.71
8.3.130.0040.01118.36
8.3.120.0150.00420.86
8.3.110.0090.00916.41
8.3.100.0030.00616.63
8.3.90.0110.00426.77
8.3.80.0090.00016.63
8.3.70.0110.00316.58
8.3.60.0040.01116.63
8.3.50.0130.00718.32
8.3.40.0100.00320.47
8.3.30.0120.00318.64
8.3.20.0080.00024.18
8.3.10.0000.00824.66
8.3.00.0080.00026.16
8.2.300.0130.00722.04
8.2.290.0030.00520.49
8.2.280.0050.00318.39
8.2.270.0150.00417.45
8.2.260.0090.00616.57
8.2.250.0090.00018.39
8.2.240.0060.00318.88
8.2.230.0080.00020.94
8.2.220.0080.00024.06
8.2.210.0050.00326.77
8.2.200.0090.00016.50
8.2.190.0070.00716.58
8.2.180.0170.00325.92
8.2.170.0120.00318.79
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0040.00419.79
8.2.110.0040.00421.12
8.2.100.0040.00817.72
8.2.90.0040.00420.42
8.2.80.0040.00418.05
8.2.70.0030.00618.05
8.2.60.0040.00418.05
8.2.50.0040.00418.10
8.2.40.0000.00820.52
8.2.30.0000.00818.13
8.2.20.0040.00419.23
8.2.10.0000.00818.04
8.2.00.0030.00519.18
8.1.340.0100.01217.55
8.1.330.0140.00421.83
8.1.320.0100.00915.97
8.1.310.0150.00318.06
8.1.300.0100.00017.89
8.1.290.0000.00830.84
8.1.280.0090.00625.92
8.1.270.0070.00024.66
8.1.260.0050.00326.35
8.1.250.0030.00628.09
8.1.240.0070.00322.66
8.1.230.0060.00620.83
8.1.220.0000.00817.76
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0050.00317.23
8.1.180.0040.00418.10
8.1.170.0040.00418.59
8.1.160.0000.00818.82
8.1.150.0000.00718.48
8.1.140.0000.00717.29
8.1.130.0050.00217.38
8.1.120.0000.00817.33
8.1.110.0030.00317.41
8.1.100.0090.00617.16
8.1.90.0100.00517.32
8.1.80.0120.00517.21
8.1.70.0050.01017.37
8.1.60.0180.00017.57
8.1.50.0190.00017.36
8.1.40.0090.00917.47
8.1.30.0140.00417.45
8.1.20.0100.01017.46
8.1.10.0150.00317.54
8.1.00.0060.01217.47
8.0.300.0080.00019.89
8.0.290.0080.00416.58
8.0.280.0040.00418.39
8.0.270.0030.00316.74
8.0.260.0000.00716.74
8.0.250.0000.00716.89
8.0.240.0000.00617.02
8.0.230.0050.00516.73
8.0.220.0090.00716.66
8.0.210.0170.00016.74
8.0.200.0150.00016.78
8.0.190.0100.00516.75
8.0.180.0100.00516.71
8.0.170.0150.00016.75
8.0.160.0040.01116.73
8.0.150.0160.00016.73
8.0.140.0070.00716.70
8.0.130.0050.00916.66
8.0.120.0040.01116.67
8.0.110.0070.00716.65
8.0.100.0120.00416.67
8.0.90.0140.00216.80
8.0.80.0110.00416.80
8.0.70.0090.00616.77
8.0.60.0100.00516.61
8.0.50.0120.00316.66
8.0.30.0000.01416.73
8.0.20.0110.00416.80
8.0.10.0100.00416.83
7.4.330.0020.00215.55
7.4.320.0030.00316.44
7.4.300.0110.00516.52
7.4.290.0060.01016.54
7.4.280.0150.00016.52
7.4.270.0040.01216.52
7.4.260.0140.00416.50
7.4.250.0090.00616.51
7.4.240.0130.00216.36
7.4.230.0040.01216.50
7.4.220.0040.00916.50
7.4.210.0100.00316.45
7.4.200.0100.00516.49
7.4.190.0040.01116.50
7.4.180.0040.00916.54
7.4.160.0080.00416.52
7.4.150.0120.00216.52
7.4.140.0120.00316.28
7.4.130.0030.00616.39
7.4.120.0000.00616.46
7.4.110.0000.00616.38
7.4.100.0040.00416.33
7.4.90.0000.00616.26
7.4.80.0030.00316.49
7.4.70.0030.00316.26
7.4.60.0000.00716.40
7.4.50.0000.00816.33
7.4.40.0070.00316.39
7.4.30.0000.00716.43
7.4.20.0060.00316.45
7.4.10.0080.00016.43
7.4.00.0080.00016.36

preferences:
87.64 ms | 1245 KiB | 5 Q