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 __call($method, $arguments){ // replaces setManufacturerName() and getManufacturerName() wich do not exist in class if (method_exists($this->_manufacturer, $method)) { return call_user_func_array(array($this->_manufacturer , $method), $arguments); } } /*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 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 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.40.0040.01118.92
8.3.30.0030.01019.40
8.3.20.0070.00020.14
8.3.10.0080.00022.05
8.3.00.0040.00422.51
8.2.170.0070.00722.96
8.2.160.0100.01020.52
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0020.00526.16
8.2.120.0000.00819.13
8.2.110.0030.00720.57
8.2.100.0000.01119.41
8.2.90.0040.00419.02
8.2.80.0000.00817.97
8.2.70.0060.00317.63
8.2.60.0040.00417.93
8.2.50.0030.00518.07
8.2.40.0040.00418.16
8.2.30.0000.00717.96
8.2.20.0070.00017.74
8.2.10.0080.00019.32
8.2.00.0000.00917.59
8.1.270.0030.00622.19
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00323.96
8.1.230.0080.00319.06
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0000.00817.53
8.1.180.0030.00618.10
8.1.170.0000.00818.62
8.1.160.0070.00022.05
8.1.150.0070.00018.69
8.1.140.0000.00717.48
8.1.130.0030.00317.83
8.1.120.0070.00017.54
8.1.110.0000.00717.47
8.1.100.0000.00717.54
8.1.90.0000.00717.38
8.1.80.0000.00717.38
8.1.70.0000.00717.48
8.1.60.0080.00317.61
8.1.50.0030.00617.58
8.1.40.0000.00817.49
8.1.30.0030.00517.55
8.1.20.0040.00417.69
8.1.10.0050.00317.50
8.1.00.0000.00717.42
8.0.300.0040.00418.77
8.0.290.0000.00717.18
8.0.280.0050.00318.39
8.0.270.0030.00517.21
8.0.260.0050.00316.76
8.0.250.0030.00316.99
8.0.240.0070.00017.01
8.0.230.0030.00316.96
8.0.220.0030.00316.93
8.0.210.0030.00316.97
8.0.200.0000.00817.00
8.0.190.0000.00716.99
8.0.180.0040.00416.84
8.0.170.0030.00517.02
8.0.160.0000.00816.90
8.0.150.0040.00416.90
8.0.140.0050.00316.90
8.0.130.0040.00413.39
8.0.120.0040.00416.93
8.0.110.0070.00016.83
8.0.100.0050.00316.73
8.0.90.0000.00716.89
8.0.80.0160.00016.88
8.0.70.0030.00516.93
8.0.60.0040.00416.97
8.0.50.0040.00416.99
8.0.30.0070.01217.30
8.0.20.0080.01017.40
8.0.10.0040.00417.09
8.0.00.0070.01316.83
7.4.330.0050.00015.09
7.4.320.0030.00316.63
7.4.300.0040.00416.59
7.4.290.0000.00716.63
7.4.280.0040.00416.54
7.4.270.0070.00016.64
7.4.260.0060.00316.57
7.4.250.0080.00016.60
7.4.240.0030.00416.66
7.4.230.0070.00016.44
7.4.220.0140.00316.66
7.4.210.0040.01116.58
7.4.200.0030.00316.34
7.4.190.0030.00316.67
7.4.160.0090.00916.57
7.4.150.0130.00317.40
7.4.140.0080.01317.86
7.4.130.0130.00716.57
7.4.120.0070.01016.70
7.4.110.0140.00316.38
7.4.100.0090.00816.65
7.4.90.0070.01316.42
7.4.80.0110.00819.39
7.4.70.0120.00616.44
7.4.60.0160.00016.49
7.4.50.0000.00816.41
7.4.40.0080.00822.77
7.4.30.0100.00716.57
7.4.10.0030.01015.11
7.4.00.0070.01114.90
7.3.330.0030.00313.34
7.3.320.0000.00513.31
7.3.310.0000.00716.38
7.3.300.0070.00016.38
7.3.290.0100.00516.31
7.3.280.0110.00816.26
7.3.270.0090.00917.40
7.3.260.0180.00316.41
7.3.250.0050.01316.53
7.3.240.0090.00916.40
7.3.230.0080.00816.39
7.3.210.0030.01416.48
7.3.200.0090.00919.39
7.3.190.0110.01116.27
7.3.180.0080.00816.47
7.3.170.0060.01316.56
7.3.160.0130.00716.55
7.3.130.0030.01615.00
7.3.120.0030.01314.97
7.3.110.0040.01114.76
7.3.100.0030.00514.82
7.3.90.0060.00914.85
7.3.80.0060.00614.74
7.3.70.0060.00515.01
7.3.60.0050.01014.74
7.3.50.0060.00914.59
7.3.40.0070.00614.82
7.3.30.0070.00514.96
7.3.20.0060.00716.49
7.3.10.0080.00516.52
7.3.00.0040.00916.57
7.2.330.0090.00916.75
7.2.320.0130.00916.89
7.2.310.0060.01116.82
7.2.300.0030.02016.79
7.2.290.0030.01216.82
7.2.260.0090.00914.98
7.2.250.0120.00614.64
7.2.240.0070.00915.17
7.2.230.0080.00715.23
7.2.220.0060.00915.08
7.2.210.0040.01015.21
7.2.200.0050.01015.13
7.2.190.0080.00614.89
7.2.180.0080.00515.14
7.2.170.0070.00615.07
7.2.160.0050.01215.04
7.2.150.0050.01116.95
7.2.140.0070.00616.87
7.2.130.0020.01116.90
7.2.120.0070.00716.78
7.2.110.0070.00316.88
7.2.100.0070.00616.86
7.2.90.0020.01316.93
7.2.80.0070.00816.87
7.2.70.0020.01016.95
7.2.60.0040.00916.76
7.2.50.0050.00916.79
7.2.40.0090.00716.90
7.2.30.0100.00517.06
7.2.20.0050.01016.88
7.2.10.0050.01016.88
7.2.00.0050.00717.71
7.1.330.0050.00715.78
7.1.320.0030.00915.90
7.1.310.0050.00715.78
7.1.300.0080.00415.63
7.1.290.0000.01015.66
7.1.280.0040.00915.69
7.1.270.0030.01315.64
7.1.260.0060.00715.69
7.1.250.0020.00915.61
7.1.240.0080.00415.61
7.1.230.0000.00915.86
7.1.220.0070.00415.78
7.1.210.0030.01015.61
7.1.200.0090.00315.84
7.1.190.0030.00615.90
7.1.180.0040.01115.81
7.1.170.0100.00615.88
7.1.160.0030.00815.93
7.1.150.0070.00715.85
7.1.140.0040.00715.71
7.1.130.0000.01315.92
7.1.120.0060.00615.83
7.1.110.0030.00915.81
7.1.100.0030.00616.90
7.1.90.0080.00515.88
7.1.80.0030.01015.55
7.1.70.0040.00416.10
7.1.60.0090.00817.80
7.1.50.0150.00316.11
7.1.40.0030.00715.82
7.1.30.0050.00515.61
7.1.20.0090.00315.85
7.1.10.0030.01015.68
7.1.00.0050.04219.10
7.0.330.0000.01315.38
7.0.320.0000.01315.47
7.0.310.0080.00015.43
7.0.300.0000.01415.39
7.0.290.0030.00615.41
7.0.280.0070.00715.32
7.0.270.0000.01015.51
7.0.260.0100.00015.47
7.0.250.0070.00715.57
7.0.240.0060.00315.47
7.0.230.0040.01115.46
7.0.220.0000.01115.23
7.0.210.0000.00815.38
7.0.200.0050.00716.17
7.0.190.0110.00415.43
7.0.180.0070.00715.40
7.0.170.0060.00915.38
7.0.160.0030.00715.39
7.0.150.0100.00315.52
7.0.140.0040.04018.76
7.0.130.0040.00415.32
7.0.120.0040.00715.38
7.0.110.0030.00715.53
7.0.100.0110.00415.52
7.0.90.0090.00615.18
7.0.80.0070.04317.67
7.0.70.0120.04217.80
7.0.60.0050.03917.71
7.0.50.0110.03617.88
7.0.40.0050.03616.91
7.0.30.0020.04516.77
7.0.20.0080.04216.75
7.0.10.0160.04016.75
7.0.00.0040.04416.62
5.6.400.0060.00614.13
5.6.390.0060.00914.31
5.6.380.0040.00714.35
5.6.370.0040.01114.65
5.6.360.0040.01414.42
5.6.350.0030.00914.63
5.6.340.0040.00414.10
5.6.330.0130.00014.43
5.6.320.0030.01414.61
5.6.310.0030.01014.08
5.6.300.0130.00314.45
5.6.290.0100.00314.28
5.6.280.0050.03717.71
5.6.270.0070.00314.18
5.6.260.0000.00914.66
5.6.250.0070.00714.51
5.6.240.0060.01214.66
5.6.230.0040.03417.58
5.6.220.0050.04517.41
5.6.210.0050.04417.50
5.6.200.0060.04717.67
5.6.190.0050.04217.75
5.6.180.0090.04117.68
5.6.170.0070.02917.73
5.6.160.0030.04117.68
5.6.150.0030.03517.66
5.6.140.0080.03817.61
5.6.130.0000.03217.87
5.6.120.0060.02917.59
5.6.110.0080.04517.59
5.6.100.0030.05317.93
5.6.90.0050.04917.82
5.6.80.0120.03717.32
5.6.70.0080.04117.50
5.6.60.0070.04417.37
5.6.50.0050.03017.22
5.6.40.0090.02517.35
5.6.30.0100.04317.41
5.6.20.0110.03717.48
5.6.10.0070.02917.48
5.6.00.0080.04317.40
5.5.380.0110.00614.66
5.5.370.0050.04617.35
5.5.360.0070.04517.33
5.5.350.0060.04217.29
5.5.340.0090.04317.70
5.5.330.0060.04117.62
5.5.320.0130.03817.56
5.5.310.0050.04517.50
5.5.300.0080.03517.70
5.5.290.0080.04517.63
5.5.280.0090.02417.62
5.5.270.0050.03117.70
5.5.260.0080.04217.63
5.5.250.0050.04617.25
5.5.240.0090.02417.26
5.5.230.0050.04117.32
5.5.220.0030.04817.32
5.5.210.0030.02717.09
5.5.200.0050.03517.22
5.5.190.0080.04317.28
5.5.180.0070.04317.15
5.5.170.0100.00314.31
5.5.160.0050.03717.21
5.5.150.0090.04217.21
5.5.140.0070.04217.20
5.5.130.0080.04417.22
5.5.120.0080.02217.29
5.5.110.0070.02917.10
5.5.100.0080.03917.25
5.5.90.0040.04117.32
5.5.80.0060.04617.11
5.5.70.0070.04517.28
5.5.60.0090.03917.07
5.5.50.0050.02717.26
5.5.40.0000.04717.06
5.5.30.0020.04417.23
5.5.20.0020.04517.18
5.5.10.0070.04317.13
5.5.00.0100.02317.17
5.4.450.0030.04615.16
5.4.440.0020.04315.24
5.4.430.0020.04415.34
5.4.420.0050.04515.29
5.4.410.0070.04215.09
5.4.400.0080.04014.98
5.4.390.0090.02315.04
5.4.380.0040.04114.89
5.4.370.0030.04315.04
5.4.360.0110.03815.18
5.4.350.0050.04314.91
5.4.340.0030.03414.85
5.4.330.0060.00310.93
5.4.320.0070.04114.96
5.4.310.0070.04114.94
5.4.300.0070.02514.98
5.4.290.0080.02014.78
5.4.280.0040.02815.12
5.4.270.0040.03915.08
5.4.260.0070.04015.12
5.4.250.0060.03915.07
5.4.240.0070.03715.04
5.4.230.0020.04714.86
5.4.220.0050.02514.88
5.4.210.0130.03515.09
5.4.200.0020.04214.98
5.4.190.0060.03615.00
5.4.180.0020.03114.94
5.4.170.0130.03514.94
5.4.160.0030.02815.02
5.4.150.0070.02615.00
5.4.140.0040.04013.52
5.4.130.0080.03513.85
5.4.120.0080.03813.75
5.4.110.0100.02513.77
5.4.100.0060.03813.66
5.4.90.0020.02813.70
5.4.80.0080.03313.82
5.4.70.0050.04113.60
5.4.60.0070.02713.68
5.4.50.0050.02513.83
5.4.40.0080.02813.76
5.4.30.0070.03213.82
5.4.20.0050.03113.71
5.4.10.0030.04113.69
5.4.00.0050.04013.48
5.3.290.0030.03212.75
5.3.280.0100.03712.62
5.3.270.0080.03912.71
5.3.260.0070.03712.65
5.3.250.0120.03312.63
5.3.240.0100.03812.67
5.3.230.0070.04012.63
5.3.220.0030.03812.66
5.3.210.0100.03912.62
5.3.200.0030.02812.63
5.3.190.0070.04212.63
5.3.180.0030.04012.58
5.3.170.0020.03312.59
5.3.160.0030.03712.61
5.3.150.0100.03312.61
5.3.140.0040.04012.64
5.3.130.0030.02712.65
5.3.120.0050.03712.70
5.3.110.0090.03812.61
5.3.100.0030.04212.38
5.3.90.0090.03312.35
5.3.80.0060.03712.39
5.3.70.0060.02512.38
5.3.60.0030.04112.39
5.3.50.0060.04112.32
5.3.40.0000.02812.37
5.3.30.0080.03512.31
5.3.20.0030.03012.20
5.3.10.0020.04012.20
5.3.00.0030.04212.22
5.2.170.0030.06711.73
5.2.160.0070.06011.73
5.2.150.0030.03011.73
5.2.140.0030.06311.73
5.2.130.0070.06011.73
5.2.120.0070.04711.73
5.2.110.0030.06311.73
5.2.100.0000.07011.73
5.2.90.0030.06311.73
5.2.80.0000.05311.73
5.2.70.0030.06011.73
5.2.60.0000.05011.73
5.2.50.0130.05011.73
5.2.40.0030.04711.73
5.2.30.0030.06311.73
5.2.20.0130.05311.73
5.2.10.0130.05011.73
5.2.00.0070.03311.73
5.1.60.0000.05311.73
5.1.50.0070.05011.73
5.1.40.0070.05011.73
5.1.30.0070.03711.73
5.1.20.0070.05311.73
5.1.10.0070.05711.73
5.1.00.0070.03011.73
5.0.50.0070.04011.73
5.0.40.0030.04711.73
5.0.30.0070.06011.73
5.0.20.0070.02011.73
5.0.10.0000.04311.73
5.0.00.0000.06711.73
4.4.90.0070.02711.73
4.4.80.0000.03711.73
4.4.70.0130.01011.73
4.4.60.0030.02011.73
4.4.50.0030.03711.73
4.4.40.0070.04711.73
4.4.30.0030.03011.73
4.4.20.0070.03311.73
4.4.10.0000.03711.73
4.4.00.0000.05311.73
4.3.110.0000.02311.73
4.3.100.0000.02311.73
4.3.90.0030.03011.73
4.3.80.0000.05711.73
4.3.70.0000.03011.73
4.3.60.0070.02711.73
4.3.50.0000.03311.73
4.3.40.0000.05311.73
4.3.30.0030.03311.73
4.3.20.0030.01311.73
4.3.10.0070.03011.73
4.3.00.0030.03711.73

preferences:
42.82 ms | 400 KiB | 5 Q