3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Manufacturer{ protected $_name; public function setManufacturerName($name){ $this->_name = $name; } public function getManufacturerName(){ return $this->_name; } } class Productt{ protected $_title; protected $_category; protected $_manufacturer; public function __construct(){ $this->_manufacturer = new Manufacturer(); } public function getCategory(){ return $this->_category; } public function getTitle(){ return $this->_title; } public function setManufacturerName($name){ $this->_manufacturer->setManufacturerName($name); } public function __clone(){ $this->_manufacturer = clone $this->_manufacturer; } // hiermee ok public function getManufacturerName(){ return $this->_manufacturer->getManufacturerName(); } } class Order extends Productt{ protected $_price; protected $_deliver; public function __construct($title, $category, $price){ parent::__construct(); $this->_title = $title; $this->_category = $category; $this->_price = $price; $this->doWeDeliver(); } public function setTitle($title){ $this->_title = $title; } public function getPrice(){ return $this->_price; } public function getDeliver(){ return $this->_deliver; } protected function doWeDeliver(){ $this->_deliver = $this->_price > 30 ? "Yes" : "No" ; } public function displaySentence(){ echo "Product: ".$this->_title." Category: ".$this->_category." Prijs: ".$this->_price." Gratis bezorging: ".$this->_deliver; } } $order = new Order("CD Brahms", "Media", "45"); $order->setManufacturerName("Producent A"); echo $order->getTitle()." is made by ". $order->getManufacturerName()."<br />"; // CD Brahms is made by Producent A $order2 = clone $order; $order2->setTitle("Second title"); $order2->setManufacturerName("Producent B"); echo $order2->getTitle()." is made by ". $order2->getManufacturerName()."<br />"; // Second title is made by Producent B echo $order->getTitle()." is made by ". $order->getManufacturerName()."<br />"; // CD Brahms is made by Producent B A with use 0f __clone()

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.0110.00718.43
8.3.50.0090.00821.99
8.3.40.0150.00018.75
8.3.30.0140.00019.22
8.3.20.0070.00020.21
8.3.10.0000.00821.95
8.3.00.0040.00422.52
8.2.180.0120.00616.88
8.2.170.0140.00722.96
8.2.160.0100.00320.52
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0070.00726.16
8.2.120.0040.00419.36
8.2.110.0080.00320.92
8.2.100.0120.00017.84
8.2.90.0080.00017.75
8.2.80.0050.00317.97
8.2.70.0080.00017.68
8.2.60.0000.00818.03
8.2.50.0000.00818.10
8.2.40.0000.00820.45
8.2.30.0040.00418.17
8.2.20.0000.00717.70
8.2.10.0040.00419.52
8.2.00.0040.00417.57
8.1.280.0120.00325.92
8.1.270.0050.00322.06
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0090.00022.22
8.1.230.0110.00022.82
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0030.00617.48
8.1.190.0050.00317.35
8.1.180.0070.00418.10
8.1.170.0040.00418.61
8.1.160.0040.00422.06
8.1.150.0050.00218.68
8.1.140.0060.00317.41
8.1.130.0000.00717.91
8.1.120.0040.00417.41
8.1.110.0050.00217.49
8.1.100.0040.00317.47
8.1.90.0050.00317.43
8.1.80.0040.00417.50
8.1.70.0000.00717.39
8.1.60.0040.00817.66
8.1.50.0000.00917.54
8.1.40.0000.00717.55
8.1.30.0000.00717.52
8.1.20.0030.00617.71
8.1.10.0000.00817.51
8.1.00.0000.00817.65
8.0.300.0020.00519.82
8.0.290.0000.00916.88
8.0.280.0030.00318.45
8.0.270.0040.00417.34
8.0.260.0030.00316.77
8.0.250.0000.00716.89
8.0.240.0000.00817.01
8.0.230.0030.00317.01
8.0.220.0040.00416.85
8.0.210.0040.00416.81
8.0.200.0030.00317.01
8.0.190.0040.00416.87
8.0.180.0000.00816.92
8.0.170.0070.00316.96
8.0.160.0070.00016.98
8.0.150.0020.00516.93
8.0.140.0000.00816.90
8.0.130.0030.00313.36
8.0.120.0000.00816.82
8.0.110.0050.00316.95
8.0.100.0000.00816.93
8.0.90.0000.00716.90
8.0.80.0090.00616.86
8.0.70.0040.00416.75
8.0.60.0000.00716.82
8.0.50.0070.00017.00
8.0.30.0130.00517.22
8.0.20.0070.01117.40
8.0.10.0030.00617.08
8.0.00.0140.00716.80
7.4.330.0030.00315.15
7.4.320.0030.00316.43
7.4.300.0000.00616.43
7.4.290.0070.00016.69
7.4.280.0000.00716.47
7.4.270.0050.00316.63
7.4.260.0070.00316.67
7.4.250.0040.00416.41
7.4.240.0040.00416.58
7.4.230.0030.00316.48
7.4.220.0100.00716.41
7.4.210.0050.01016.64
7.4.200.0080.00016.57
7.4.190.0030.00616.60
7.4.160.0060.00916.52
7.4.150.0090.00917.40
7.4.140.0080.00917.86
7.4.130.0120.00616.58
7.4.120.0120.00916.63
7.4.110.0130.01016.61
7.4.100.0100.01016.55
7.4.90.0110.00716.57
7.4.80.0090.00919.39
7.4.70.0080.00816.45
7.4.60.0090.01216.57
7.4.50.0000.00816.44
7.4.40.0110.00722.77
7.4.30.0110.00816.42
7.4.00.0060.00914.78
7.3.330.0030.00313.34
7.3.320.0060.00013.11
7.3.310.0030.00516.39
7.3.300.0050.00216.29
7.3.290.0120.00616.34
7.3.280.0100.00716.34
7.3.270.0130.01017.40
7.3.260.0060.01316.32
7.3.250.0100.00716.55
7.3.240.0060.01016.50
7.3.230.0100.00716.44
7.3.210.0170.00016.52
7.3.200.0150.00919.39
7.3.190.0030.01616.37
7.3.180.0040.01116.56
7.3.170.0140.00616.42
7.3.160.0040.01416.44
7.3.120.0100.00714.60
7.2.330.0090.00916.91
7.2.320.0140.01016.89
7.2.310.0100.00716.59
7.2.300.0110.01116.83
7.2.290.0070.01716.45
7.2.60.0040.01216.61
7.2.00.0000.01419.54
7.1.200.0100.00315.50
7.1.100.0110.00317.94
7.1.70.0000.01416.70
7.1.60.0100.01419.82
7.1.50.0100.01417.01
7.1.00.0000.08022.46
7.0.200.0030.00516.53
7.0.140.0000.07722.08
7.0.60.0000.05720.13
7.0.50.0030.04017.89
7.0.40.0100.08720.13
7.0.30.0200.06320.08
7.0.20.0270.04320.23
7.0.10.0030.09020.25
7.0.00.0000.04320.24
5.6.280.0000.07721.09
5.6.210.0170.07020.65
5.6.200.0170.04318.19
5.6.190.0030.05320.58
5.6.180.0170.07320.77
5.6.170.0400.07320.57
5.6.160.0100.03720.46
5.6.150.0270.05718.16
5.6.140.0070.07718.28
5.6.130.0000.04318.17
5.6.120.0030.08721.16
5.6.110.0030.09020.88
5.6.100.0030.05020.99
5.6.90.0170.06721.02
5.6.80.0070.06020.46
5.6.70.4370.03320.30
5.5.350.0130.08720.40
5.5.340.0030.04018.05
5.5.330.0070.06720.40
5.5.320.0270.05720.29
5.5.310.0330.07320.42
5.5.300.0100.07717.99
5.5.290.0070.04017.94
5.5.280.0170.07020.79
5.5.270.0100.07020.84
5.5.260.0100.06020.78
5.5.250.0070.07720.71
5.5.240.0300.06720.28
5.4.450.0130.06319.47
5.4.440.0200.05719.31
5.4.430.0800.05319.54
5.4.420.0730.06019.39
5.4.410.0200.05318.96
5.4.400.0830.00018.77
5.4.390.0800.00018.72
5.4.380.0270.05318.79
5.4.370.0270.04018.76
5.4.360.0100.05318.80
5.4.350.0130.05318.79
5.4.340.0100.05718.74
5.4.320.0060.04212.52
5.4.310.0070.03712.52
5.4.300.0040.03812.52
5.4.290.0070.04112.52
5.4.280.0060.03512.42
5.4.270.0100.05319.09
5.4.260.0030.06018.94
5.4.250.0170.06318.90
5.4.240.0130.06018.90
5.4.230.0170.06318.76
5.4.220.0100.07318.90
5.4.210.0170.07019.00
5.4.200.0100.08018.83
5.4.190.0130.06718.98
5.4.180.0130.06018.79
5.4.170.0070.06318.98
5.4.160.0170.07318.98
5.4.150.0100.07718.98
5.4.140.0130.06016.52
5.4.130.0170.05716.47
5.4.120.0200.05316.47
5.4.110.0070.07016.48
5.4.100.0030.06716.62
5.4.90.0030.05716.41
5.4.80.0230.05316.61
5.4.70.0070.05016.69
5.4.60.0070.06016.55
5.4.50.0130.05016.39
5.4.40.0070.06016.51
5.4.30.0070.06016.36
5.4.20.0100.07016.59
5.4.10.0070.05716.35
5.4.00.0130.06015.86
5.3.290.0050.04112.80
5.3.280.0200.06014.80
5.3.270.0200.06314.71
5.3.260.0130.06314.60
5.3.250.0170.06314.46
5.3.240.0070.05314.62
5.3.230.0100.07314.62
5.3.220.0170.06714.73
5.3.210.0070.05714.68
5.3.200.0030.06014.49
5.3.190.0270.05014.42
5.3.180.0100.04714.66
5.3.170.0030.05714.56
5.3.160.0070.06714.56
5.3.150.0170.06014.72
5.3.140.0070.06714.76
5.3.130.0170.07014.40
5.3.120.0170.04714.56
5.3.110.0030.05714.59
5.3.100.0070.05314.05
5.3.90.0100.05314.03
5.3.80.0030.06714.20
5.3.70.0100.06314.22
5.3.60.0100.05013.85
5.3.50.0100.06713.99
5.3.40.0030.07014.05
5.3.30.0100.06713.92
5.3.20.0230.04313.71
5.3.10.0170.05713.75
5.3.00.0100.05713.73
5.2.170.0000.06311.13
5.2.160.0130.03711.14
5.2.150.0070.05311.36
5.2.140.0170.05311.33
5.2.130.0100.05311.10
5.2.120.0100.04011.13
5.2.110.0070.05011.12
5.2.100.0200.04011.10
5.2.90.0070.04011.08
5.2.80.0200.05011.08
5.2.70.0070.06010.95
5.2.60.0030.05011.08
5.2.50.0070.04711.04
5.2.40.0130.04711.02
5.2.30.0030.05011.18
5.2.20.0100.03711.07
5.2.10.0030.05311.05
5.2.00.0130.04710.97
5.1.60.0100.0309.95
5.1.50.0070.03310.02
5.1.40.0100.0479.95
5.1.30.0030.03710.43
5.1.20.0030.03710.60
5.1.10.0070.04310.02
5.1.00.0100.03310.17
5.0.50.0000.0438.54
5.0.40.0070.0378.48
5.0.30.0070.0508.45
5.0.20.0030.0378.29
5.0.10.0000.0338.19
5.0.00.0030.0478.17
4.4.90.0030.0236.00
4.4.80.0030.0236.00
4.4.70.0030.0206.00
4.4.60.0070.0206.00
4.4.50.0030.0206.00
4.4.40.0070.0335.99
4.4.30.0070.0275.99
4.4.20.0100.0175.99
4.4.10.0070.0275.99
4.4.00.0030.0435.99
4.3.110.0000.0235.98
4.3.100.0000.0335.98
4.3.90.0030.0205.98
4.3.80.0030.0335.98
4.3.70.0100.0235.98
4.3.60.0030.0205.98
4.3.50.0070.0235.98
4.3.40.0030.0305.98
4.3.30.0030.0205.98
4.3.20.0000.0235.98
4.3.10.0100.0135.98
4.3.00.0000.0237.33

preferences:
38.85 ms | 401 KiB | 5 Q