3v4l.org

run code in 300+ PHP versions simultaneously
<?php # Model class Car { private $name = null; private $description = null; private $price = 0; public function __construct($name, $price, $description = null) { $this->name = $name; $this->description = $description; $this->price = $price; } public function setName($name) {$this->name = $name;} public function getName() {return $this->name; } public function setDescription($description) {$this->description = $description; } public function getDescription() {return $this->description; } public function setPrice($price) {$this->price = $price;} public function getPrice() {return $this->price;} } # Presenter class CarPresenter { private $car; public function __construct($car) { $this->car = $car; } public function __call($method, $params = array()) { #if(method_exists($this, $method)) { # call_user_func_array(array($this, $method), $params); #} else if(method_exists($this->car, $method)) { return call_user_func_array(array($this->car, $method), $params); } } public function isExpesive() { return $this->car->getPrice() > 45000; } public function getDescription() { $description = $this->car->getDescription(); return is_null($description) ? 'No description' : $description; } } $car = new Car('Ferrari', 2000000); $car_presenter = new CarPresenter($car); echo $car_presenter->getName(); echo $car_presenter->isExpensive(); echo $car_presenter->getDescription();

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.0030.01218.16
8.3.50.0080.00822.11
8.3.40.0110.00418.61
8.3.30.0110.00419.04
8.3.20.0000.00820.30
8.3.10.0040.00421.92
8.3.00.0030.00622.39
8.2.180.0060.01216.50
8.2.170.0120.00322.96
8.2.160.0150.00021.20
8.2.150.0000.00824.18
8.2.140.0090.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00417.63
8.2.110.0000.00919.31
8.2.100.0090.00317.91
8.2.90.0030.00517.97
8.2.80.0080.00017.97
8.2.70.0030.00618.03
8.2.60.0000.00818.09
8.2.50.0080.00018.10
8.2.40.0080.00019.34
8.2.30.0080.00019.25
8.2.20.0030.00617.70
8.2.10.0080.00019.46
8.2.00.0060.00317.63
8.1.280.0110.00725.92
8.1.270.0000.00922.03
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0040.00423.97
8.1.230.0040.00820.90
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0040.00417.48
8.1.190.0080.00417.38
8.1.180.0030.00618.10
8.1.170.0060.00318.64
8.1.160.0050.00218.98
8.1.150.0070.00018.60
8.1.140.0000.00717.36
8.1.130.0030.00317.92
8.1.120.0000.00917.48
8.1.110.0000.00717.39
8.1.100.0080.00017.53
8.1.90.0000.00717.49
8.1.80.0050.00317.43
8.1.70.0050.00317.45
8.1.60.0060.00617.63
8.1.50.0030.00517.63
8.1.40.0080.00017.56
8.1.30.0000.00817.66
8.1.20.0040.00417.59
8.1.10.0000.00717.53
8.1.00.0000.00717.41
8.0.300.0070.00019.98
8.0.290.0030.00616.63
8.0.280.0070.00018.48
8.0.270.0000.00717.18
8.0.260.0030.00316.92
8.0.250.0030.00316.89
8.0.240.0000.00916.95
8.0.230.0040.00417.04
8.0.220.0000.00716.83
8.0.210.0070.00016.90
8.0.200.0030.00316.97
8.0.190.0000.00717.04
8.0.180.0000.00817.02
8.0.170.0000.00816.96
8.0.160.0060.00316.91
8.0.150.0040.00416.95
8.0.140.0040.00316.94
8.0.130.0030.00313.43
8.0.120.0040.00416.88
8.0.110.0050.00316.89
8.0.100.0000.00716.80
8.0.90.0030.00516.90
8.0.80.0030.01216.82
8.0.70.0030.00516.97
8.0.60.0070.00016.79
8.0.50.0040.00416.86
8.0.30.0100.00817.04
8.0.20.0120.00617.40
8.0.10.0040.00416.96
8.0.00.0130.00816.66
7.4.330.0050.00015.00
7.4.320.0030.00316.41
7.4.300.0070.00016.66
7.4.290.0070.00016.68
7.4.280.0070.00016.54
7.4.270.0060.00316.60
7.4.260.0000.01016.52
7.4.250.0000.00716.65
7.4.240.0060.00116.54
7.4.230.0000.00716.63
7.4.220.0070.01016.67
7.4.210.0050.01316.56
7.4.200.0030.00316.62
7.4.190.0040.00416.64
7.4.160.0100.00716.50
7.4.150.0110.00717.40
7.4.140.0100.00917.86
7.4.130.0120.00616.64
7.4.120.0060.01116.51
7.4.110.0120.00816.61
7.4.100.0120.00616.46
7.4.90.0080.00816.52
7.4.80.0080.00919.39
7.4.70.0050.01116.42
7.4.60.0110.00716.63
7.4.50.0080.00016.48
7.4.40.0130.00322.77
7.4.30.0090.00716.60
7.4.00.0060.01015.01
7.3.330.0030.00313.28
7.3.320.0030.00313.18
7.3.310.0000.00716.13
7.3.300.0030.00316.22
7.3.290.0060.00916.27
7.3.280.0100.00916.29
7.3.270.0070.01017.40
7.3.260.0120.00916.45
7.3.250.0100.00816.33
7.3.240.0130.00316.40
7.3.230.0070.01316.53
7.3.210.0090.01216.32
7.3.200.0060.00919.39
7.3.190.0150.00316.62
7.3.180.0080.00816.35
7.3.170.0080.00816.44
7.3.160.0080.00816.41
7.3.120.0070.01014.62
7.3.110.0110.00714.61
7.3.100.0090.00614.55
7.3.90.0090.00314.76
7.3.80.0110.00014.74
7.3.70.0030.01514.75
7.3.60.0050.00514.91
7.3.50.0030.01014.70
7.3.40.0070.01014.80
7.3.30.0030.00914.76
7.3.20.0090.00016.66
7.3.10.0040.00716.61
7.3.00.0080.00816.80
7.2.330.0090.00916.55
7.2.320.0160.00316.75
7.2.310.0100.00616.64
7.2.300.0130.01016.81
7.2.290.0100.00616.84
7.2.250.0090.00915.27
7.2.240.0000.01915.27
7.2.230.0060.00915.30
7.2.220.0060.00615.15
7.2.210.0000.01315.25
7.2.200.0040.00815.04
7.2.190.0110.00415.13
7.2.180.0100.00314.96
7.2.170.0090.00315.07
7.2.60.0060.00917.03
7.2.00.0000.01219.17
7.1.330.0090.00315.99
7.1.320.0080.00615.76
7.1.310.0030.00715.70
7.1.300.0030.00615.73
7.1.290.0110.00415.75
7.1.280.0000.01415.98
7.1.270.0130.00015.78
7.1.260.0030.00615.99
7.1.200.0070.00315.59
7.1.100.0000.01217.98
7.1.70.0000.00717.02
7.1.60.0110.01519.82
7.1.50.0070.01417.05
7.1.00.0030.07722.57
7.0.200.0120.00416.80
7.0.140.0070.07021.95
7.0.60.0070.05320.00
7.0.50.0100.07317.88
7.0.40.0130.08019.96
7.0.30.0270.06720.23
7.0.20.0270.05720.07
7.0.10.0200.06320.19
7.0.00.0130.07320.32
5.6.280.0070.07021.07
5.6.210.0030.09020.48
5.6.200.0130.07018.18
5.6.190.0130.07320.39
5.6.180.0370.04020.64
5.6.170.0470.06320.45
5.6.160.0100.05320.44
5.6.150.0130.07018.19
5.6.140.0030.04718.18
5.6.130.0000.04718.13
5.6.120.0130.07720.98
5.6.110.0070.07321.20
5.6.100.0130.06320.98
5.6.90.0170.07721.09
5.6.80.0170.08020.54
5.5.350.0100.07720.51
5.5.340.0030.03717.99
5.5.330.0030.04020.21
5.5.320.0470.06720.35
5.5.310.0200.04020.34
5.5.300.0100.08018.04
5.5.290.0170.07017.98
5.5.280.0100.07721.00
5.5.270.0070.08720.84
5.5.260.0030.05720.77
5.5.250.0000.04720.59
5.5.240.0100.07720.18
5.4.450.0300.07019.48
5.4.440.0670.05019.58
5.4.430.0130.05019.63
5.4.420.0130.05319.51
5.4.410.0070.06318.73
5.4.400.0100.05318.78
5.4.390.0070.05718.75
5.4.380.0130.06318.54
5.4.370.0670.05718.64
5.4.360.0700.05318.76
5.4.350.0870.04718.73
5.4.340.0670.05718.74
5.4.320.0060.03712.52
5.4.310.0120.03612.52
5.4.300.0060.04012.52
5.4.290.0070.03812.51
5.4.280.0050.04012.41
5.4.270.0170.06718.97
5.4.260.0030.05318.77
5.4.250.0070.07719.00
5.4.240.0270.06318.96
5.4.230.0000.08318.98
5.4.220.0100.05018.66
5.4.210.0070.05318.76
5.4.200.0100.07018.96
5.4.190.0200.04719.09
5.4.180.0100.06019.00
5.4.170.0200.04319.09
5.4.160.0100.05018.64
5.4.150.0030.05718.95
5.4.140.0100.07316.54
5.4.130.0130.04316.44
5.4.120.0070.06016.53
5.4.110.0070.07016.54
5.4.100.0130.04316.47
5.4.90.0200.06016.58
5.4.80.0100.04316.53
5.4.70.0170.06016.53
5.4.60.0130.05316.39
5.4.50.0070.05016.38
5.4.40.0100.04716.65
5.4.30.0100.05316.63
5.4.20.0030.05316.32
5.4.10.0170.06316.37
5.4.00.0000.05316.03
5.3.290.0140.03812.80
5.3.280.0100.05714.52
5.3.270.0100.05314.70
5.3.260.0130.05314.46
5.3.250.0070.07014.65
5.3.240.0070.05714.81
5.3.230.0200.06014.52
5.3.220.0130.06714.66
5.3.210.0070.05014.73
5.3.200.0070.07314.72
5.3.190.0100.05714.76
5.3.180.0130.04314.58
5.3.170.0100.07014.77
5.3.160.0200.05714.77
5.3.150.0170.06314.65
5.3.140.0030.05014.75
5.3.130.0100.05014.47
5.3.120.0030.07714.73
5.3.110.0030.08014.66
5.3.100.0130.04714.06
5.3.90.0070.05014.01
5.3.80.0100.05314.07
5.3.70.0130.05013.95
5.3.60.0070.05014.10
5.3.50.0070.04713.94
5.3.40.0100.05314.05
5.3.30.0100.06714.01
5.3.20.0030.05013.69
5.3.10.0100.04313.75
5.3.00.0070.05713.56
5.2.170.0000.04711.25
5.2.160.0100.05311.15
5.2.150.0100.03711.24
5.2.140.0070.04011.23
5.2.130.0030.04010.96
5.2.120.0030.06011.13
5.2.110.0070.04010.95
5.2.100.0030.06011.22
5.2.90.0030.05711.34
5.2.80.0070.03711.19
5.2.70.0100.03711.18
5.2.60.0070.05311.15
5.2.50.0100.04011.12
5.2.40.0100.05011.11
5.2.30.0070.04311.16
5.2.20.0070.04311.15
5.2.10.0070.03710.71
5.2.00.0070.05310.81
5.1.60.0030.03310.01
5.1.50.0130.04010.02
5.1.40.0170.03710.07
5.1.30.0130.02710.32
5.1.20.0170.04010.56
5.1.10.0000.04010.02
5.1.00.0070.04010.10
5.0.50.0030.0308.64
5.0.40.0070.0338.48
5.0.30.0030.0408.27
5.0.20.0100.0308.29
5.0.10.0100.0278.11
5.0.00.0130.0338.25
4.4.90.0070.0176.99
4.4.80.0070.0236.99
4.4.70.0000.0306.99
4.4.60.0070.0206.99
4.4.50.0030.0206.99
4.4.40.0030.0406.99
4.4.30.0000.0236.99
4.4.20.0070.0176.99
4.4.10.0070.0206.99
4.4.00.0070.0406.99
4.3.110.0030.0206.99
4.3.100.0000.0336.99
4.3.90.0070.0236.99
4.3.80.0030.0336.99
4.3.70.0000.0206.99
4.3.60.0030.0206.99
4.3.50.0000.0336.99
4.3.40.0000.0436.99
4.3.30.0030.0206.99
4.3.20.0070.0176.99
4.3.10.0000.0236.99
4.3.00.0070.0206.81

preferences:
47.48 ms | 401 KiB | 5 Q