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 __clone(){ $this->_manufacturer = clone $this->_manufacturer; } public function setManufacturerName($name){ $this->_manufacturer->setManufacturerName($name); } 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 X"); 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 A

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.0150.00618.55
8.3.50.0090.00921.99
8.3.40.0060.00918.79
8.3.30.0110.00419.08
8.3.20.0040.00420.18
8.3.10.0040.00421.97
8.3.00.0090.00022.49
8.2.180.0140.00716.75
8.2.170.0170.00322.96
8.2.160.0030.01020.52
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0130.00726.16
8.2.120.0000.00817.50
8.2.110.0090.00022.16
8.2.100.0080.00419.29
8.2.90.0080.00019.17
8.2.80.0030.00617.97
8.2.70.0050.00517.38
8.2.60.0030.00517.93
8.2.50.0000.00818.07
8.2.40.0040.00418.28
8.2.30.0040.00417.98
8.2.20.0000.00717.65
8.2.10.0000.00819.34
8.2.00.0040.00417.71
8.1.280.0110.00425.92
8.1.270.0080.00022.11
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0060.00323.88
8.1.230.0070.00319.02
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0000.00917.23
8.1.190.0000.00817.43
8.1.180.0040.00418.10
8.1.170.0000.00818.59
8.1.160.0000.00822.09
8.1.150.0040.00418.59
8.1.140.0000.00717.45
8.1.130.0030.00317.85
8.1.120.0070.00017.49
8.1.110.0050.00217.39
8.1.100.0040.00417.42
8.1.90.0030.00617.38
8.1.80.0000.00717.48
8.1.70.0000.00717.49
8.1.60.0000.01117.66
8.1.50.0040.00417.48
8.1.40.0030.00517.62
8.1.30.0050.00317.60
8.1.20.0080.00017.72
8.1.10.0040.00417.62
8.1.00.0040.00417.51
8.0.300.0040.00418.77
8.0.290.0000.00717.18
8.0.280.0070.00018.48
8.0.270.0040.00417.29
8.0.260.0000.00716.93
8.0.250.0030.00316.88
8.0.240.0040.00416.97
8.0.230.0050.00316.95
8.0.220.0040.00216.88
8.0.210.0030.00316.96
8.0.200.0000.00717.04
8.0.190.0040.00416.89
8.0.180.0040.00416.99
8.0.170.0050.00316.98
8.0.160.0030.00616.92
8.0.150.0030.00316.88
8.0.140.0050.00316.94
8.0.130.0000.00613.34
8.0.120.0000.00716.86
8.0.110.0040.00416.90
8.0.100.0000.00816.82
8.0.90.0000.00716.88
8.0.80.0060.01016.96
8.0.70.0000.00816.85
8.0.60.0000.00816.81
8.0.50.0050.00316.78
8.0.30.0090.01017.25
8.0.20.0030.01517.40
8.0.10.0000.00817.12
8.0.00.0110.01116.71
7.4.330.0000.00515.14
7.4.320.0060.00016.67
7.4.300.0000.00716.56
7.4.290.0000.00716.55
7.4.280.0070.00016.52
7.4.270.0030.00316.63
7.4.260.0030.00716.46
7.4.250.0040.00416.59
7.4.240.0020.00616.52
7.4.230.0070.00016.34
7.4.220.0070.01016.48
7.4.210.0070.00716.61
7.4.200.0000.00716.45
7.4.190.0040.00316.68
7.4.160.0090.00916.64
7.4.150.0120.00617.40
7.4.140.0080.01117.86
7.4.130.0030.01416.52
7.4.120.0060.01116.57
7.4.110.0060.01016.63
7.4.100.0160.00616.65
7.4.90.0200.00316.54
7.4.80.0120.01119.39
7.4.70.0160.00316.51
7.4.60.0070.01016.45
7.4.50.0040.00416.45
7.4.40.0120.00722.77
7.4.30.0030.01516.60
7.4.00.0040.01215.18
7.3.330.0000.00813.27
7.3.320.0060.00013.30
7.3.310.0000.00716.31
7.3.300.0030.00316.34
7.3.290.0030.01016.37
7.3.280.0090.00816.32
7.3.270.0100.00717.40
7.3.260.0140.00316.25
7.3.250.0080.00916.51
7.3.240.0100.01316.34
7.3.230.0090.00916.39
7.3.210.0060.01316.47
7.3.200.0090.00619.39
7.3.190.0080.01516.63
7.3.180.0100.00616.48
7.3.170.0080.00816.52
7.3.160.0060.01216.48
7.3.120.0030.01414.66
7.2.330.0120.00616.82
7.2.320.0160.00716.66
7.2.310.0120.00416.91
7.2.300.0120.01216.65
7.2.290.0100.00616.84
7.2.120.0120.00816.73
7.2.110.0090.00416.81
7.2.100.0140.00716.33
7.2.90.0090.01216.70
7.2.80.0100.00716.72
7.2.70.0180.00416.85
7.2.60.0080.01317.08
7.2.50.0160.00516.89
7.2.40.0160.00316.79
7.2.30.0120.00616.97
7.2.20.0110.00816.81
7.2.10.0100.00817.03
7.2.00.0050.00718.17
7.1.240.0080.00815.76
7.1.230.0120.00315.70
7.1.220.0140.00315.92
7.1.210.0180.00015.68
7.1.200.0140.00215.88
7.1.190.0150.00315.80
7.1.180.0080.00815.70
7.1.170.0100.00715.64
7.1.160.0120.00315.70
7.1.150.0060.00615.54
7.1.140.0110.00815.66
7.1.130.0140.00415.50
7.1.120.0070.00715.76
7.1.110.0130.00515.84
7.1.100.0080.00517.13
7.1.90.0170.00315.76
7.1.80.0040.01315.82
7.1.70.0070.00316.26
7.1.60.0090.01017.88
7.1.50.0120.00916.48
7.1.40.0060.00615.62
7.1.30.0060.00915.46
7.1.20.0170.00015.69
7.1.10.0100.00315.55
7.1.00.0100.04419.05
7.0.320.0090.00515.16
7.0.310.0070.01115.40
7.0.300.0080.00815.44
7.0.290.0030.01215.31
7.0.280.0090.00915.13
7.0.270.0090.00315.61
7.0.260.0180.00015.18
7.0.250.0160.00015.36
7.0.240.0070.00515.64
7.0.230.0090.00415.31
7.0.220.0060.01015.54
7.0.210.0080.00815.30
7.0.200.0090.00316.00
7.0.190.0150.00415.50
7.0.180.0070.00715.14
7.0.170.0000.01215.18
7.0.160.0110.00715.38
7.0.150.0100.00515.25
7.0.140.0080.03718.81
7.0.130.0100.00715.24
7.0.120.0070.00715.59
7.0.110.0130.00815.20
7.0.100.0030.00715.29
7.0.90.0060.00615.45
7.0.80.0080.00315.11
7.0.70.0030.00515.45
7.0.60.0050.04017.79
7.0.50.0100.04216.73
7.0.40.0050.04016.68
7.0.30.0150.02716.77
7.0.20.0480.02616.75
7.0.10.0080.02816.80
7.0.00.0080.04116.65
5.6.380.0140.00314.58
5.6.370.0140.00014.29
5.6.360.0170.00314.42
5.6.350.0110.00314.34
5.6.340.0090.00614.09
5.6.330.0130.00014.63
5.6.320.0130.00014.66
5.6.310.0060.01214.77
5.6.300.0160.00014.50
5.6.290.0080.00614.40
5.6.280.0130.03517.47
5.6.270.0080.00814.68
5.6.260.0100.00714.30
5.6.250.0000.01214.38
5.6.240.0070.00714.17
5.6.230.0130.00014.31
5.6.220.0060.00314.29
5.6.210.0100.04017.60
5.6.200.0000.02816.29
5.6.190.0050.02917.53
5.6.180.1580.02717.55
5.6.170.0160.04217.36
5.6.160.0090.02217.54
5.6.150.0060.03816.22
5.6.140.0050.03316.26
5.6.130.0020.05016.33
5.6.120.0050.04017.92
5.6.110.0020.04717.82
5.6.100.0100.04317.72
5.6.90.0030.02817.72
5.6.80.0080.03717.49
5.6.70.0200.03917.48
5.6.60.0120.00314.41
5.6.50.0100.00714.27
5.6.40.0030.01014.38
5.6.30.0100.00314.29
5.6.20.0030.01314.09
5.6.10.0060.00614.52
5.6.00.0040.00814.43
5.5.380.0000.01111.45
5.5.370.0030.00611.27
5.5.360.0030.00511.40
5.5.350.0020.04515.90
5.5.340.0050.02314.63
5.5.330.0050.04815.79
5.5.320.0170.04115.89
5.5.310.0140.02515.82
5.5.300.0070.02214.71
5.5.290.0080.02814.62
5.5.280.0030.04316.13
5.5.270.0050.04516.09
5.5.260.0060.03016.02
5.5.250.0080.03116.00
5.5.240.0150.03315.79
5.5.230.0040.00711.27
5.5.220.0050.00511.27
5.5.210.0070.00311.36
5.5.200.0080.00411.27
5.5.190.0000.01111.27
5.5.180.0060.00611.27
5.5.170.0070.00714.19
5.5.160.0090.00311.27
5.5.150.0000.01211.40
5.5.140.0090.00311.27
5.5.130.0100.00011.35
5.5.120.0000.00911.27
5.5.110.0060.00611.27
5.5.100.0040.00411.32
5.5.90.0030.00611.34
5.5.80.0040.00711.27
5.5.70.0060.00611.38
5.5.60.0050.00311.27
5.5.50.0060.00611.28
5.5.40.0090.00311.36
5.5.30.0070.00411.33
5.5.20.0090.00311.28
5.5.10.0090.00011.27
5.5.00.0030.00311.38
5.4.450.0160.03815.47
5.4.440.0190.04015.42
5.4.430.0100.04215.34
5.4.420.0120.04115.37
5.4.410.0170.04015.38
5.4.400.0190.03615.13
5.4.390.0100.02315.21
5.4.380.0160.03715.20
5.4.370.0210.03615.18
5.4.360.0140.03115.20
5.4.350.0130.03915.17
5.4.340.0180.02915.18
5.4.330.0000.01011.27
5.4.320.0160.03215.25
5.4.310.0150.03015.22
5.4.300.0210.02215.13
5.4.290.0130.03415.18
5.4.280.0200.03615.07
5.4.270.0150.02815.29
5.4.260.0200.03515.24
5.4.250.0150.02615.25
5.4.240.0170.03515.24
5.4.230.0140.03215.24
5.4.220.0210.03515.17
5.4.210.0160.03815.25
5.4.200.0180.03015.21
5.4.190.0150.03415.13
5.4.180.0150.04015.20
5.4.170.0150.02515.13
5.4.160.0180.03515.28
5.4.150.0170.03615.23
5.4.140.0130.02414.00
5.4.130.0220.03713.89
5.4.120.0120.03413.84
5.4.110.0100.02313.75
5.4.100.0140.03613.94
5.4.90.0170.03313.79
5.4.80.0120.02713.97
5.4.70.0170.03213.91
5.4.60.0130.04013.89
5.4.50.0120.02713.90
5.4.40.0120.02813.86
5.4.30.0150.02613.80
5.4.20.0180.03313.85
5.4.10.0150.04013.90
5.4.00.0150.02113.55
5.3.290.0130.04112.98
5.3.280.0150.03013.01
5.3.270.0130.03612.97
5.3.260.0200.02812.95
5.3.250.0180.02912.90
5.3.240.0180.02312.90
5.3.230.0130.04113.02
5.3.220.0160.02312.97
5.3.210.0110.02612.89
5.3.200.0170.03412.93
5.3.190.0170.03012.88
5.3.180.0130.02512.96
5.3.170.0210.02312.94
5.3.160.0150.03912.92
5.3.150.0170.02112.88
5.3.140.0130.04312.91
5.3.130.0180.03512.96
5.3.120.0100.02512.88
5.3.110.0170.04312.87
5.3.100.0140.03112.71
5.3.90.0150.04012.60
5.3.80.0150.03512.61
5.3.70.0200.02412.77
5.3.60.0180.03312.61
5.3.50.0200.03512.73
5.3.40.0170.03212.62
5.3.30.0120.02812.61
5.3.20.0170.03612.60
5.3.10.0100.02912.44
5.3.00.0150.02312.58
5.2.170.0130.03311.83
5.2.160.0130.03311.83
5.2.150.0170.02711.83
5.2.140.0180.01511.83
5.2.130.0170.02711.83
5.2.120.0120.01911.83
5.2.110.0110.02511.83
5.2.100.0150.02111.83
5.2.90.0150.02211.83
5.2.80.0130.02111.83
5.2.70.0130.03011.83
5.2.60.0120.03011.83
5.2.50.0130.02711.83
5.2.40.0050.02011.83
5.2.30.0070.02211.83
5.2.20.0080.01811.83
5.2.10.0070.01611.83
5.2.00.0050.01711.83
5.1.60.0070.01411.83
5.1.50.0100.01211.83
5.1.40.0090.01211.83
5.1.30.0090.01311.83
5.1.20.0060.01611.83
5.1.10.0050.02011.83
5.1.00.0070.01711.83
5.0.50.0050.01511.83
5.0.40.0050.01011.83
5.0.30.0030.01911.83
5.0.20.0040.01211.83
5.0.10.0030.01311.83
5.0.00.0050.01511.83
4.4.90.0080.00811.83
4.4.80.0030.01211.83
4.4.70.0030.01011.83
4.4.60.0020.01011.83
4.4.50.0070.00711.83
4.4.40.0070.01311.83
4.4.30.0040.00811.83
4.4.20.0020.02311.83
4.4.10.0030.01211.83
4.4.00.0060.01211.83
4.3.110.0030.01111.83
4.3.100.0080.00711.83
4.3.90.0020.01311.83
4.3.80.0020.01711.83
4.3.70.0030.01011.83
4.3.60.0030.01011.83
4.3.50.0050.00811.83
4.3.40.0020.01511.83
4.3.30.0020.01011.83
4.3.20.0020.01011.83
4.3.10.0020.01011.83
4.3.00.0020.01011.83

preferences:
39.97 ms | 401 KiB | 5 Q