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); } elseif(method_exists($this->car, $method)) { 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.0160.00018.35
8.3.50.0100.00622.05
8.3.40.0060.01219.01
8.3.30.0030.01019.05
8.3.20.0040.00420.29
8.3.10.0040.00421.97
8.3.00.0080.00022.40
8.2.180.0090.00616.73
8.2.170.0110.00422.96
8.2.160.0130.00321.23
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0050.00226.16
8.2.120.0080.00019.48
8.2.110.0040.00422.21
8.2.100.0160.00017.78
8.2.90.0040.00419.20
8.2.80.0040.00417.98
8.2.70.0080.00017.50
8.2.60.0040.00417.92
8.2.50.0040.00418.07
8.2.40.0080.00017.94
8.2.30.0030.00618.16
8.2.20.0050.00217.64
8.2.10.0000.00819.34
8.2.00.0030.00517.78
8.1.280.0120.00925.92
8.1.270.0030.00622.13
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0030.00723.82
8.1.230.0040.00818.95
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0080.00317.48
8.1.190.0060.00317.52
8.1.180.0040.00418.10
8.1.170.0000.00818.64
8.1.160.0040.00421.96
8.1.150.0040.00418.74
8.1.140.0040.00417.49
8.1.130.0000.00717.79
8.1.120.0070.00417.50
8.1.110.0050.00217.49
8.1.100.0040.00417.43
8.1.90.0000.00717.56
8.1.80.0040.00317.40
8.1.70.0000.00717.42
8.1.60.0040.00717.61
8.1.50.0000.00717.53
8.1.40.0000.00817.54
8.1.30.0000.00817.54
8.1.20.0000.00817.68
8.1.10.0040.00417.58
8.1.00.0060.00317.54
8.0.300.0000.00818.77
8.0.290.0070.00017.28
8.0.280.0080.00018.41
8.0.270.0030.00417.18
8.0.260.0040.00416.82
8.0.250.0030.00316.89
8.0.240.0040.00416.92
8.0.230.0000.00716.99
8.0.220.0000.00716.86
8.0.210.0030.00316.93
8.0.200.0030.00317.05
8.0.190.0040.00416.91
8.0.180.0080.00017.02
8.0.170.0040.00416.98
8.0.160.0060.00316.97
8.0.150.0000.00716.88
8.0.140.0080.00016.91
8.0.130.0040.00413.40
8.0.120.0030.00516.96
8.0.110.0000.00716.96
8.0.100.0030.00516.94
8.0.90.0030.00516.89
8.0.80.0060.01316.89
8.0.70.0040.00416.82
8.0.60.0000.00816.84
8.0.50.0040.00416.79
8.0.30.0100.00917.05
8.0.20.0130.00617.40
8.0.10.0040.00416.99
8.0.00.0100.01116.91
7.4.330.0020.00215.14
7.4.320.0030.00316.57
7.4.300.0030.00316.55
7.4.290.0040.00416.64
7.4.280.0030.00316.66
7.4.270.0070.00016.57
7.4.260.0030.00716.65
7.4.250.0000.00716.63
7.4.240.0000.00716.57
7.4.230.0020.00516.75
7.4.220.0150.00316.68
7.4.210.0090.00616.65
7.4.200.0070.00016.49
7.4.190.0070.00016.60
7.4.160.0100.00616.41
7.4.150.0150.00917.40
7.4.140.0150.00617.86
7.4.130.0040.01616.54
7.4.120.0080.00816.56
7.4.110.0130.01016.59
7.4.100.0060.01616.59
7.4.90.0100.00916.49
7.4.80.0030.01519.39
7.4.70.0080.00816.45
7.4.60.0030.01416.54
7.4.50.0040.00416.40
7.4.40.0040.01222.77
7.4.30.0090.00816.42
7.4.00.0060.00815.00
7.3.330.0030.00413.16
7.3.320.0030.00213.35
7.3.310.0000.00816.35
7.3.300.0030.00316.20
7.3.290.0030.01016.32
7.3.280.0090.00916.32
7.3.270.0100.00717.40
7.3.260.0070.01016.43
7.3.250.0130.00716.43
7.3.240.0140.00316.55
7.3.230.0110.00916.46
7.3.210.0130.00316.38
7.3.200.0130.01019.39
7.3.190.0140.00716.36
7.3.180.0110.00616.64
7.3.170.0060.01016.46
7.3.160.0140.00716.56
7.3.120.0070.00914.99
7.3.110.0070.01014.70
7.3.100.0070.00715.11
7.3.90.0060.00914.83
7.3.80.0070.00715.14
7.3.70.0060.00914.63
7.3.60.0030.00614.92
7.3.50.0080.00614.75
7.3.40.0090.00014.87
7.3.30.0070.00714.43
7.3.20.0100.00616.51
7.3.10.0100.01016.63
7.3.00.0030.01316.48
7.2.330.0140.00416.84
7.2.320.0170.00916.86
7.2.310.0080.00816.78
7.2.300.0070.01316.90
7.2.290.0100.00716.75
7.2.250.0060.00915.29
7.2.240.0030.01615.15
7.2.230.0030.01315.28
7.2.220.0030.01014.89
7.2.210.0060.00914.68
7.2.200.0070.01014.86
7.2.190.0060.00814.88
7.2.180.0040.00715.14
7.2.170.0060.00915.18
7.1.330.0060.01015.60
7.1.320.0030.01015.87
7.1.310.0030.01015.72
7.1.300.0060.00915.58
7.1.290.0040.00815.68
7.1.280.0070.01015.75
7.1.270.0000.01115.82
7.1.260.0070.01115.84
7.1.100.0030.01318.05
7.1.70.0060.00617.17
7.1.60.0060.00617.12
7.1.50.0070.01716.95
7.1.00.0030.07722.36
7.0.200.0000.01116.77
7.0.140.0030.07322.10
7.0.60.0100.07720.03
7.0.50.0030.04018.01
7.0.40.0070.08720.10
7.0.30.0270.04320.10
7.0.20.0370.07720.09
7.0.10.0100.06320.19
7.0.00.0000.04320.08
5.6.280.0070.07021.04
5.6.210.0000.08720.53
5.6.200.0030.04018.19
5.6.190.0070.06020.39
5.6.180.0400.06720.46
5.6.170.0370.06720.56
5.6.160.0100.04020.62
5.6.150.0130.06318.27
5.6.140.0000.05718.15
5.6.130.0030.04018.16
5.6.120.0130.07020.97
5.6.110.0070.04020.97
5.6.100.0100.08320.97
5.6.90.0130.03321.07
5.6.80.0100.07020.41
5.6.70.3900.04020.41
5.5.350.0400.06020.47
5.5.340.0030.05018.03
5.5.330.0070.09020.30
5.5.320.0300.04720.57
5.5.310.0300.06720.34
5.5.300.0030.04717.97
5.5.290.0000.04317.95
5.5.280.0070.04320.98
5.5.270.0030.09020.98
5.5.260.0070.03720.81
5.5.250.0130.06720.68
5.5.240.0030.04020.28
5.4.450.0170.05719.56
5.4.440.0300.05019.49
5.4.430.0170.04719.38
5.4.420.0100.05319.63
5.4.410.0130.05718.74
5.4.400.0470.04318.55
5.4.390.0500.06318.77
5.4.380.0200.05718.60
5.4.370.0200.02718.79
5.4.360.0130.03718.59
5.4.350.0220.08912.03
5.4.340.0150.03912.02
5.4.320.0070.03812.52
5.4.310.0050.04912.52
5.4.300.0080.04212.52
5.4.290.0080.04412.51
5.4.280.0060.04012.41
5.4.270.0130.04718.95
5.4.260.0000.08318.85
5.4.250.0070.05318.84
5.4.240.0070.07318.99
5.4.230.0100.07018.84
5.4.220.0030.05718.89
5.4.210.0130.07018.96
5.4.200.0070.05019.09
5.4.190.0030.05318.95
5.4.180.0130.04318.96
5.4.170.0030.05318.80
5.4.160.0000.05718.99
5.4.150.0100.05318.99
5.4.140.0070.05716.45
5.4.130.0100.04316.61
5.4.120.0100.04316.43
5.4.110.0070.06716.46
5.4.100.0100.04316.68
5.4.90.0100.04716.61
5.4.80.0030.06716.40
5.4.70.0000.05316.57
5.4.60.0070.06716.51
5.4.50.0100.06316.35
5.4.40.0030.05316.45
5.4.30.0170.05316.32
5.4.20.0030.05316.38
5.4.10.0100.05316.48
5.4.00.0170.06016.04
5.3.290.0080.04312.80
5.3.280.0070.07014.70
5.3.270.0030.05314.63
5.3.260.0100.06014.79
5.3.250.0070.04714.69
5.3.240.0070.05714.85
5.3.230.0070.05714.86
5.3.220.0030.05014.59
5.3.210.0070.05014.64
5.3.200.0100.04714.67
5.3.190.0030.07714.77
5.3.180.0100.06314.57
5.3.170.0200.03714.67
5.3.160.0070.05314.81
5.3.150.0000.05714.59
5.3.140.0100.05314.66
5.3.130.0170.04314.54
5.3.120.0130.06714.73
5.3.110.0070.05014.57
5.3.100.0100.05314.22
5.3.90.0170.06014.05
5.3.80.0030.05314.14
5.3.70.0030.05314.27
5.3.60.0100.06314.04
5.3.50.0200.05714.04
5.3.40.0070.05713.98
5.3.30.0030.05313.84
5.3.20.0030.05013.69
5.3.10.0100.04313.75
5.3.00.0030.05713.88
5.2.170.0000.04711.17
5.2.160.0070.03711.17
5.2.150.0030.04011.28
5.2.140.0030.05311.34
5.2.130.0030.04711.35
5.2.120.0130.04711.10
5.2.110.0030.04711.21
5.2.100.0070.05311.28
5.2.90.0070.03711.19
5.2.80.0030.06011.17
5.2.70.0000.06311.11
5.2.60.0100.04711.16
5.2.50.0200.03711.12
5.2.40.0170.03011.09
5.2.30.0070.04011.08
5.2.20.0100.05011.20
5.2.10.0030.05010.78
5.2.00.0130.03010.83
5.1.60.0030.03310.00
5.1.50.0100.03310.07
5.1.40.0100.03010.10
5.1.30.0000.05310.42
5.1.20.0100.03710.38
5.1.10.0130.04010.29
5.1.00.0070.04710.19
5.0.50.0000.0408.58
5.0.40.0100.0238.41
5.0.30.0130.0478.22
5.0.20.0000.0308.27
5.0.10.0070.0378.26
5.0.00.0100.0438.39
4.4.90.0030.0306.99
4.4.80.0000.0336.99
4.4.70.0070.0276.99
4.4.60.0070.0176.99
4.4.50.0070.0276.99
4.4.40.0070.0406.99
4.4.30.0130.0106.99
4.4.20.0070.0206.99
4.4.10.0070.0176.99
4.4.00.0070.0336.99
4.3.110.0000.0236.99
4.3.100.0000.0236.98
4.3.90.0030.0306.98
4.3.80.0030.0306.98
4.3.70.0000.0336.98
4.3.60.0070.0176.98
4.3.50.0030.0236.98
4.3.40.0070.0306.98
4.3.30.0000.0236.98
4.3.20.0030.0276.98
4.3.10.0000.0236.98
4.3.00.0000.0236.70

preferences:
46.81 ms | 401 KiB | 5 Q