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.0000.01918.43
8.3.50.0090.00622.11
8.3.40.0090.00918.83
8.3.30.0000.01419.22
8.3.20.0070.00020.32
8.3.10.0080.00022.07
8.3.00.0000.00822.57
8.2.180.0140.00417.00
8.2.170.0070.00722.96
8.2.160.0090.00920.64
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0040.00419.36
8.2.110.0040.00422.30
8.2.100.0120.00318.03
8.2.90.0040.00419.34
8.2.80.0050.00317.97
8.2.70.0000.00817.63
8.2.60.0040.00417.93
8.2.50.0000.00918.07
8.2.40.0040.00418.16
8.2.30.0030.00518.11
8.2.20.0040.00417.64
8.2.10.0080.00019.44
8.2.00.0050.00317.73
8.1.280.0140.00325.92
8.1.270.0060.00322.13
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0090.00023.97
8.1.230.0050.00519.07
8.1.220.0080.00017.79
8.1.210.0000.00818.77
8.1.200.0080.00417.35
8.1.190.0080.00017.65
8.1.180.0040.00418.10
8.1.170.0050.00318.73
8.1.160.0000.00721.93
8.1.150.0040.00418.60
8.1.140.0040.00417.51
8.1.130.0000.00717.89
8.1.120.0030.00617.56
8.1.110.0040.00417.53
8.1.100.0040.00417.47
8.1.90.0000.00817.57
8.1.80.0040.00417.50
8.1.70.0070.00017.40
8.1.60.0000.01017.66
8.1.50.0000.00717.56
8.1.40.0040.00417.46
8.1.30.0030.00517.66
8.1.20.0050.00317.62
8.1.10.0000.00817.65
8.1.00.0080.00017.43
8.0.300.0070.00018.77
8.0.290.0070.00017.05
8.0.280.0000.00818.59
8.0.270.0030.00317.19
8.0.260.0000.00816.95
8.0.250.0000.00716.96
8.0.240.0040.00317.03
8.0.230.0070.00017.06
8.0.220.0030.00316.93
8.0.210.0030.00316.96
8.0.200.0030.00316.95
8.0.190.0040.00417.07
8.0.180.0070.00017.05
8.0.170.0030.00517.09
8.0.160.0020.00517.06
8.0.150.0070.00016.95
8.0.140.0000.00716.88
8.0.130.0000.00513.41
8.0.120.0040.00417.00
8.0.110.0070.00016.98
8.0.100.0050.00316.88
8.0.90.0050.00416.98
8.0.80.0120.00317.04
8.0.70.0000.00816.90
8.0.60.0000.00716.89
8.0.50.0040.00417.06
8.0.30.0100.00817.12
8.0.20.0040.01717.40
8.0.10.0040.00416.98
8.0.00.0110.00916.90
7.4.330.0000.00515.15
7.4.320.0000.00616.55
7.4.300.0030.00316.55
7.4.290.0050.00216.57
7.4.280.0000.00816.55
7.4.270.0070.00016.54
7.4.260.0000.01016.61
7.4.250.0070.00016.61
7.4.240.0040.00316.51
7.4.230.0040.00316.55
7.4.220.0090.00916.58
7.4.210.0100.00716.50
7.4.200.0030.00316.67
7.4.190.0030.00316.71
7.4.160.0120.00316.59
7.4.150.0090.00917.40
7.4.140.0070.01417.86
7.4.130.0090.00816.54
7.4.120.0060.01216.61
7.4.110.0070.01116.60
7.4.100.0100.00716.72
7.4.90.0060.01216.53
7.4.80.0060.00919.39
7.4.70.0060.01016.64
7.4.60.0070.01016.59
7.4.50.0000.00816.42
7.4.40.0080.00822.77
7.4.30.0100.01016.63
7.4.00.0050.00714.98
7.3.330.0030.00313.39
7.3.320.0030.00213.40
7.3.310.0000.00716.45
7.3.300.0030.00316.35
7.3.290.0000.01416.39
7.3.280.0130.00416.35
7.3.270.0040.01217.40
7.3.260.0090.00916.66
7.3.250.0120.00916.44
7.3.240.0150.00316.55
7.3.230.0150.00416.44
7.3.210.0000.01616.40
7.3.200.0180.00019.39
7.3.190.0150.00316.52
7.3.180.0070.00916.39
7.3.170.0130.00316.55
7.3.160.0060.00916.38
7.3.120.0050.00814.85
7.3.110.0080.00414.88
7.3.100.0020.00814.68
7.3.90.0060.00714.92
7.3.80.0050.00714.91
7.3.70.0070.00614.88
7.3.60.0050.00914.79
7.3.50.0050.00714.79
7.3.40.0000.01014.88
7.3.30.0050.00714.87
7.3.20.0050.00816.56
7.3.10.0070.00616.54
7.3.00.0060.00816.62
7.2.330.0110.00716.87
7.2.320.0140.00516.61
7.2.310.0100.00716.84
7.2.300.0130.01216.61
7.2.290.0130.00316.62
7.2.250.0030.00915.26
7.2.240.0050.00815.07
7.2.230.0040.01114.93
7.2.220.0050.00915.08
7.2.210.0030.01015.10
7.2.200.0030.00915.01
7.2.190.0060.00714.95
7.2.180.0070.00515.12
7.2.170.0080.00614.98
7.2.160.0070.00714.99
7.2.150.0060.00716.80
7.2.140.0060.00716.97
7.2.130.0040.01116.95
7.2.120.0050.00916.91
7.2.110.0070.00616.88
7.2.100.0060.00916.90
7.2.90.0070.00816.86
7.2.80.0060.00816.91
7.2.70.0080.00617.03
7.2.60.0030.00916.91
7.2.50.0080.00616.90
7.2.40.0020.01216.81
7.2.30.0090.00516.94
7.2.20.0020.01016.77
7.2.10.0060.00716.85
7.2.00.0040.00917.51
7.1.330.0020.00815.76
7.1.320.0020.01015.83
7.1.310.0030.00915.72
7.1.300.0060.00615.78
7.1.290.0050.00615.76
7.1.280.0070.00715.74
7.1.270.0060.00615.75
7.1.260.0020.01215.77
7.1.250.0040.01015.83
7.1.240.0030.00915.76
7.1.230.0110.00015.48
7.1.220.0070.00415.62
7.1.210.0040.00815.82
7.1.200.0050.00515.71
7.1.190.0070.00415.84
7.1.180.0030.00715.68
7.1.170.0040.00715.90
7.1.160.0000.01215.62
7.1.150.0090.00315.70
7.1.140.0040.00715.64
7.1.130.0070.00415.72
7.1.120.0030.00715.82
7.1.110.0100.00015.71
7.1.100.0050.00716.71
7.1.90.0000.01115.50
7.1.80.0070.00315.59
7.1.70.0040.00516.40
7.1.60.0060.01117.80
7.1.50.0050.01216.38
7.1.40.0000.01115.94
7.1.30.0000.01115.81
7.1.20.0100.00015.84
7.1.10.0030.00715.75
7.1.00.0080.03718.95
7.0.330.0070.00415.29
7.0.320.0030.00815.38
7.0.310.0040.00815.49
7.0.300.0020.00815.44
7.0.290.0100.00015.36
7.0.280.0030.00715.39
7.0.270.0000.01115.44
7.0.260.0040.00715.45
7.0.250.0030.00715.48
7.0.240.0000.01115.60
7.0.230.0050.00515.58
7.0.220.0020.00715.55
7.0.210.0070.00415.45
7.0.200.0060.00815.97
7.0.190.0070.00415.50
7.0.180.0000.01015.21
7.0.170.0080.00315.27
7.0.160.0090.00215.21
7.0.150.0070.00315.61
7.0.140.0080.03518.78
7.0.130.0000.01115.62
7.0.120.0040.00715.49
7.0.110.0050.00515.23
7.0.100.0070.00415.17
7.0.90.0030.00715.32
7.0.80.0030.00715.73
7.0.70.0000.01015.40
7.0.60.0100.03717.72
7.0.50.0080.03216.64
7.0.40.0080.04316.80
7.0.30.0110.03016.76
7.0.20.0190.02816.79
7.0.10.0020.03016.79
7.0.00.0020.02816.84
5.6.400.0070.00314.61
5.6.390.0040.00814.63
5.6.380.0060.00614.24
5.6.370.0080.00314.38
5.6.360.0000.01114.55
5.6.350.0040.00814.38
5.6.340.0030.00813.93
5.6.330.0040.00714.34
5.6.320.0000.01114.32
5.6.310.0040.00714.27
5.6.300.0040.00714.29
5.6.290.0110.00014.30
5.6.280.0020.04017.79
5.6.270.0080.00414.18
5.6.260.0070.00414.46
5.6.250.0080.00414.52
5.6.240.0070.00414.35
5.6.230.0040.00714.64
5.6.220.0000.01114.61
5.6.210.0030.04217.45
5.6.200.0050.02216.29
5.6.190.0050.02417.46
5.6.180.0270.03917.47
5.6.170.0120.02317.35
5.6.160.0020.03417.52
5.6.150.0080.03416.29
5.6.140.0050.03816.27
5.6.130.0070.03816.23
5.6.120.0050.04717.69
5.6.110.0080.04217.69
5.6.100.0060.04617.66
5.6.90.0050.04717.90
5.6.80.0050.04617.38
5.6.70.0060.00614.52
5.6.60.0100.00014.23
5.6.50.0040.00814.45
5.6.40.0000.01114.43
5.6.30.0000.01114.27
5.6.20.0050.00514.26
5.6.10.0070.00313.97
5.6.00.0000.01114.41
5.5.380.0040.00714.07
5.5.370.0040.00814.10
5.5.360.0080.00414.24
5.5.350.0120.02417.27
5.5.340.0030.03516.15
5.5.330.0080.02617.33
5.5.320.0100.03217.18
5.5.310.0170.03017.29
5.5.300.0020.04516.06
5.5.290.0070.04216.14
5.5.280.0080.04317.59
5.5.270.0040.02417.44
5.5.260.0050.02517.58
5.5.250.0020.04217.37
5.5.240.0080.03817.14
5.5.230.0070.00314.15
5.5.220.0040.00714.31
5.5.210.0100.00014.44
5.5.200.0110.00014.45
5.5.190.0040.00714.44
5.5.180.0040.00713.80
5.5.170.0030.00714.09
5.5.160.0070.00314.46
5.5.150.0000.01114.35
5.5.140.0040.00714.02
5.5.130.0030.00714.22
5.5.120.0040.00714.27
5.5.110.0000.01014.05
5.5.100.0030.00714.36
5.5.90.0000.01114.31
5.5.80.0070.00314.36
5.5.70.0000.01114.38
5.5.60.0050.00514.50
5.5.50.0080.00314.30
5.5.40.0040.00814.08
5.5.30.0060.00614.40
5.5.20.0070.00414.38
5.5.10.0030.00714.43
5.5.00.0110.00014.33
5.4.450.0380.04015.31
5.4.440.0250.04015.40
5.4.430.0110.02515.33
5.4.420.0050.03415.38
5.4.410.0000.03514.97
5.4.400.0030.03115.02
5.4.390.0070.02714.91
5.4.380.0100.02514.98
5.4.370.0140.02314.89
5.4.360.0130.02514.90
5.4.350.0080.03414.97
5.4.340.0100.02914.97
5.4.330.0000.00611.34
5.4.320.0060.01911.86
5.4.310.0030.02311.86
5.4.300.0040.02011.86
5.4.290.0050.02111.86
5.4.280.0030.02811.80
5.4.270.0070.03415.02
5.4.260.0070.04015.08
5.4.250.0140.03415.10
5.4.240.0100.02515.07
5.4.230.0050.04114.99
5.4.220.0090.03215.08
5.4.210.0090.03814.96
5.4.200.0070.02715.00
5.4.190.0030.03615.14
5.4.180.0070.03214.99
5.4.170.0070.03214.96
5.4.160.0120.03315.07
5.4.150.0050.03215.09
5.4.140.0030.03713.84
5.4.130.0080.03513.82
5.4.120.0080.03413.92
5.4.110.0070.02713.82
5.4.100.0100.02013.91
5.4.90.0050.03913.85
5.4.80.0070.03713.92
5.4.70.0040.02913.87
5.4.60.0070.02513.80
5.4.50.0050.03613.77
5.4.40.0060.02613.86
5.4.30.0100.02213.83
5.4.20.0090.02513.79
5.4.10.0080.02613.77
5.4.00.0030.03013.60
5.3.290.0050.02112.00
5.3.280.0070.02912.89
5.3.270.0070.03212.92
5.3.260.0090.03412.91
5.3.250.0070.02712.83
5.3.240.0120.03012.99
5.3.230.0100.02713.02
5.3.220.0050.03812.81
5.3.210.0100.02312.89
5.3.200.0050.03312.88
5.3.190.0120.02213.00
5.3.180.0070.03512.85
5.3.170.0030.02912.93
5.3.160.0030.04212.89
5.3.150.0080.03512.89
5.3.140.0080.02712.96
5.3.130.0050.03212.87
5.3.120.0120.02212.92
5.3.110.0070.02512.87
5.3.100.0000.03312.62
5.3.90.0030.03312.70
5.3.80.0080.03212.60
5.3.70.0140.02212.61
5.3.60.0080.03212.66
5.3.50.0070.03012.59
5.3.40.0070.02512.62
5.3.30.0080.02712.61
5.3.20.0100.02712.48
5.3.10.0030.03012.39
5.3.00.0020.03412.42
5.2.170.0070.04011.16
5.2.160.0070.05011.24
5.2.150.0030.04311.39
5.2.140.0070.04711.07
5.2.130.0070.04711.20
5.2.120.0100.03711.21
5.2.110.0070.04011.09
5.2.100.0100.03311.03
5.2.90.0030.04011.20
5.2.80.0030.05010.94
5.2.70.0030.06311.20
5.2.60.0130.04011.29
5.2.50.0100.03710.99
5.2.40.0030.04011.09
5.2.30.0170.03011.08
5.2.20.0100.03311.16
5.2.10.0070.05010.89
5.2.00.0030.04010.82
5.1.60.0100.03010.02
5.1.50.0100.02710.09
5.1.40.0030.03310.24
5.1.30.0130.02710.44
5.1.20.0100.03010.46
5.1.10.0070.04710.09
5.1.00.0000.04310.05
5.0.50.0000.0338.52
5.0.40.0000.0308.27
5.0.30.0030.0508.31
5.0.20.0070.0238.46
5.0.10.0070.0308.20
5.0.00.0070.0408.15
4.4.90.0070.0176.98
4.4.80.0000.0276.98
4.4.70.0130.0136.98
4.4.60.0030.0276.92
4.4.50.0030.0306.92
4.4.40.0030.0336.92
4.4.30.0030.0206.92
4.4.20.0000.0236.92
4.4.10.0070.0276.92
4.4.00.0030.0376.92
4.3.110.0000.0236.92
4.3.100.0000.0236.92
4.3.90.0100.0236.91
4.3.80.0000.0476.98
4.3.70.0030.0206.98
4.3.60.0100.0206.98
4.3.50.0000.0236.98
4.3.40.0000.0336.98
4.3.30.0000.0236.98
4.3.20.0030.0206.98
4.3.10.0000.0236.98
4.3.00.0100.0236.95

preferences:
37.75 ms | 400 KiB | 5 Q