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){ // check that the other object has the specified method if (method_exists($this->_manufacturer, $method)) { // invoke the method and return any result return call_user_func_array(array($this->_manufacturer , $method), $arguments); } } } 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.0140.00018.68
8.3.50.0110.00421.97
8.3.40.0140.00418.82
8.3.30.0110.00319.01
8.3.20.0070.00020.38
8.3.10.0040.00421.79
8.3.00.0050.00322.40
8.2.180.0090.00616.59
8.2.170.0110.00422.96
8.2.160.0070.00720.57
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0030.00619.48
8.2.110.0070.00422.10
8.2.100.0060.00617.63
8.2.90.0090.00019.30
8.2.80.0080.00018.05
8.2.70.0050.00517.63
8.2.60.0030.00517.93
8.2.50.0040.00418.10
8.2.40.0000.00818.22
8.2.30.0050.00218.06
8.2.20.0060.00317.63
8.2.10.0040.00419.38
8.2.00.0040.00417.60
8.1.280.0140.00025.92
8.1.270.0050.00322.18
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0090.00023.92
8.1.230.0090.00320.39
8.1.220.0000.00817.74
8.1.210.0000.00918.77
8.1.200.0060.00317.35
8.1.190.0000.00817.23
8.1.180.0060.00318.10
8.1.170.0040.00418.61
8.1.160.0050.00322.05
8.1.150.0040.00418.73
8.1.140.0040.00417.49
8.1.130.0070.00017.79
8.1.120.0040.00417.38
8.1.110.0000.00817.46
8.1.100.0040.00417.50
8.1.90.0000.00717.48
8.1.80.0000.00717.47
8.1.70.0050.00317.48
8.1.60.0030.01017.56
8.1.50.0040.00417.44
8.1.40.0000.00917.52
8.1.30.0030.00517.65
8.1.20.0040.00417.65
8.1.10.0040.00417.68
8.1.00.0000.00917.53
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0070.00018.39
8.0.270.0000.00717.32
8.0.260.0030.00316.85
8.0.250.0040.00416.90
8.0.240.0040.00416.89
8.0.230.0040.00416.95
8.0.220.0000.00716.98
8.0.210.0000.00716.94
8.0.200.0030.00317.00
8.0.190.0000.00716.91
8.0.180.0080.00016.96
8.0.170.0000.00816.84
8.0.160.0070.00016.80
8.0.150.0070.00016.75
8.0.140.0000.00716.86
8.0.130.0000.00613.44
8.0.120.0040.00416.94
8.0.110.0080.00016.96
8.0.100.0050.00316.83
8.0.90.0040.00416.87
8.0.80.0030.01216.88
8.0.70.0040.00416.76
8.0.60.0040.00416.82
8.0.50.0000.00716.76
8.0.30.0080.01117.25
8.0.20.0090.00817.40
8.0.10.0040.00416.96
8.0.00.0120.00716.75
7.4.330.0060.00015.00
7.4.320.0000.00616.69
7.4.300.0030.00316.61
7.4.290.0070.00016.59
7.4.280.0030.00516.49
7.4.270.0030.00316.46
7.4.260.0030.00716.57
7.4.250.0000.00816.52
7.4.240.0000.00716.65
7.4.230.0040.00416.74
7.4.220.0120.00616.71
7.4.210.0070.00716.63
7.4.200.0000.00716.56
7.4.190.0000.00816.62
7.4.160.0060.00916.57
7.4.150.0040.01517.40
7.4.140.0100.01017.86
7.4.130.0130.00716.50
7.4.120.0070.01116.50
7.4.110.0120.00816.44
7.4.100.0170.00016.55
7.4.90.0100.00716.43
7.4.80.0120.00919.39
7.4.70.0140.00316.45
7.4.60.0000.01816.31
7.4.50.0040.00416.57
7.4.40.0110.00722.77
7.4.30.0110.00416.46
7.4.10.0030.01414.95
7.4.00.0050.01214.94
7.3.330.0040.00413.20
7.3.320.0030.00313.40
7.3.310.0000.00716.24
7.3.300.0000.00716.33
7.3.290.0060.00916.29
7.3.280.0080.00816.32
7.3.270.0180.00717.40
7.3.260.0090.01216.64
7.3.250.0130.00416.45
7.3.240.0140.00416.69
7.3.230.0090.01216.39
7.3.210.0090.00916.41
7.3.200.0110.00719.39
7.3.190.0030.01716.46
7.3.180.0120.00316.68
7.3.170.0130.01016.43
7.3.160.0070.01116.59
7.3.130.0110.00714.64
7.3.120.0070.01014.67
7.3.110.0100.01014.89
7.3.100.0100.00315.01
7.3.90.0070.01015.13
7.3.80.0060.01214.97
7.3.70.0040.00814.70
7.3.60.0030.01414.82
7.3.50.0130.00714.55
7.3.40.0160.00014.89
7.3.30.0070.00714.61
7.3.20.0090.00616.61
7.3.10.0050.00516.51
7.3.00.0040.00816.70
7.2.330.0120.00616.66
7.2.320.0150.00916.48
7.2.310.0070.01016.71
7.2.300.0100.00716.57
7.2.290.0080.00816.93
7.2.260.0030.01514.98
7.2.250.0120.00915.04
7.2.240.0000.01315.32
7.2.230.0030.01015.12
7.2.220.0090.00914.87
7.2.210.0030.00915.04
7.2.200.0030.00715.12
7.2.190.0190.00315.05
7.2.180.0030.01715.20
7.2.170.0050.01015.22
7.2.160.0070.00714.71
7.2.150.0060.00616.75
7.2.140.0100.00017.02
7.2.130.0040.01516.90
7.2.120.0070.00317.10
7.2.110.0080.00416.69
7.2.100.0090.00616.84
7.2.90.0030.01016.88
7.2.80.0060.00917.04
7.2.70.0090.00617.00
7.2.60.0030.01116.96
7.2.50.0070.00716.98
7.2.40.0040.00817.11
7.2.30.0080.00816.97
7.2.20.0000.01116.93
7.2.10.0120.00016.92
7.2.00.0030.01317.03
7.1.330.0000.00915.75
7.1.320.0070.01015.74
7.1.310.0130.00315.65
7.1.300.0000.01815.88
7.1.290.0040.01515.87
7.1.280.0030.01115.95
7.1.270.0070.00715.77
7.1.260.0070.00715.76
7.1.250.0100.00715.94
7.1.240.0000.01215.80
7.1.230.0040.01115.81
7.1.220.0060.00615.55
7.1.210.0060.00315.55
7.1.200.0070.00715.63
7.1.190.0000.00915.73
7.1.180.0060.00615.94
7.1.170.0040.01115.49
7.1.160.0030.00615.76
7.1.150.0100.00315.44
7.1.140.0000.00915.77
7.1.130.0030.01015.48
7.1.120.0030.00615.65
7.1.110.0060.00915.59
7.1.100.0000.01415.81
7.1.90.0000.00915.93
7.1.80.0090.00315.59
7.1.70.0070.00316.24
7.1.60.0060.01217.88
7.1.50.0050.01516.46
7.1.40.0110.00015.86
7.1.30.0040.00715.68
7.1.20.0090.00615.82
7.1.10.0000.01415.88
7.1.00.0050.04219.02
7.0.330.0030.01315.48
7.0.320.0100.00315.49
7.0.310.0080.00615.45
7.0.300.0100.00315.11
7.0.290.0060.00915.23
7.0.280.0100.00315.49
7.0.270.0110.00315.61
7.0.260.0070.00715.58
7.0.250.0060.00915.14
7.0.240.0120.00015.45
7.0.230.0060.00915.53
7.0.220.0060.00615.25
7.0.210.0030.01015.30
7.0.200.0060.00616.03
7.0.190.0110.00015.51
7.0.180.0000.01215.18
7.0.170.0000.01415.37
7.0.160.0070.00715.32
7.0.150.0070.00715.55
7.0.140.0030.04318.70
7.0.130.0000.01715.25
7.0.120.0100.00315.55
7.0.110.0090.00615.18
7.0.100.0030.00915.52
7.0.90.0140.00315.38
7.0.80.0070.00715.46
7.0.70.0040.00715.32
7.0.60.0120.03517.78
7.0.50.0070.04416.61
7.0.40.0030.02916.91
7.0.30.0180.04216.86
7.0.20.0170.04316.91
7.0.10.0190.03516.73
7.0.00.0090.03116.76
5.6.400.0030.01314.76
5.6.390.0030.01314.18
5.6.380.0030.01414.40
5.6.370.0000.01314.39
5.6.360.0040.00414.71
5.6.350.0110.00414.59
5.6.340.0050.00514.61
5.6.330.0070.00314.28
5.6.320.0100.00614.33
5.6.310.0090.00614.55
5.6.300.0040.01214.56
5.6.290.0100.00314.55
5.6.280.0050.03817.80
5.6.270.0060.00914.52
5.6.260.0090.00414.22
5.6.250.0060.00914.50
5.6.240.0070.00714.66
5.6.230.0040.01114.25
5.6.220.0030.00714.09
5.6.210.0080.04217.51
5.6.200.0080.04516.37
5.6.190.0100.04817.40
5.6.180.1630.02317.51
5.6.170.0200.04217.51
5.6.160.0080.04217.55
5.6.150.0100.02016.20
5.6.140.0170.02216.15
5.6.130.0080.04416.25
5.6.120.0110.04117.72
5.6.110.0030.04317.69
5.6.100.0090.04417.88
5.6.90.0100.03717.82
5.6.80.0040.02317.44
5.6.70.0200.03217.34
5.6.60.0040.01114.59
5.6.50.0060.01214.33
5.6.40.0100.00314.29
5.6.30.0000.01314.58
5.6.20.0000.01514.11
5.6.10.0000.01414.29
5.6.00.0100.00314.31
5.5.380.0000.01714.55
5.5.370.0100.00714.62
5.5.360.0040.01114.39
5.5.350.0030.03017.47
5.5.340.0070.04416.11
5.5.330.0060.02417.38
5.5.320.0130.02517.49
5.5.310.0140.02517.43
5.5.300.0040.04416.35
5.5.290.0070.03316.10
5.5.280.0070.04817.53
5.5.270.0050.02517.73
5.5.260.0070.04517.84
5.5.250.0000.03117.23
5.5.240.0050.04817.12
5.5.230.0000.01614.34
5.5.220.0070.00714.12
5.5.210.0100.00614.07
5.5.200.0030.00714.32
5.5.190.0130.00314.14
5.5.180.0060.00614.40
5.5.170.0000.00814.12
5.5.160.0110.00314.34
5.5.150.0030.01014.49
5.5.140.0040.01114.00
5.5.130.0030.00914.20
5.5.120.0000.01214.08
5.5.110.0040.00814.19
5.5.100.0080.00414.29
5.5.90.0040.01114.14
5.5.80.0000.01614.31
5.5.70.0070.00714.18
5.5.60.0080.00514.43
5.5.50.0030.00914.29
5.5.40.0000.01414.41
5.5.30.0070.00714.30
5.5.20.0030.01114.27
5.5.10.0000.01414.04
5.5.00.0000.01414.33
5.4.450.0310.03815.37
5.4.440.0400.03315.15
5.4.430.0080.04115.29
5.4.420.0070.03215.35
5.4.410.0030.03615.35
5.4.400.0630.00514.96
5.4.390.0420.00314.96
5.4.380.0170.03514.99
5.4.370.0100.02814.83
5.4.360.0130.02614.89
5.4.350.0030.03914.93
5.4.340.0150.02215.02
5.4.330.0070.00011.20
5.4.320.0030.02211.65
5.4.310.0070.02211.79
5.4.300.0050.01911.81
5.4.290.0020.02611.72
5.4.280.0070.01811.75
5.4.270.0050.04015.07
5.4.260.0080.03514.97
5.4.250.0040.03715.03
5.4.240.0070.04215.03
5.4.230.0070.04215.09
5.4.220.0030.03715.09
5.4.210.0050.04014.92
5.4.200.0050.04115.12
5.4.190.0100.03714.90
5.4.180.0070.03815.02
5.4.170.0130.03014.80
5.4.160.0110.03315.12
5.4.150.0130.03415.06
5.4.140.0020.04513.87
5.4.130.0080.03513.81
5.4.120.0060.03614.02
5.4.110.0060.03314.03
5.4.100.0050.03913.63
5.4.90.0100.03413.83
5.4.80.0040.03913.76
5.4.70.0090.02913.67
5.4.60.0110.03513.81
5.4.50.0030.04113.85
5.4.40.0050.02913.88
5.4.30.0110.03113.67
5.4.20.0020.04413.75
5.4.10.0060.03813.76
5.4.00.0070.03213.55
5.3.290.0050.02211.72
5.3.280.0100.03212.56
5.3.270.0030.04412.66
5.3.260.0100.04212.69
5.3.250.0070.03612.60
5.3.240.0070.03712.63
5.3.230.0040.04012.64
5.3.220.0100.02812.55
5.3.210.0060.03512.66
5.3.200.0090.03012.65
5.3.190.0050.03912.64
5.3.180.0020.03212.60
5.3.170.0120.03212.64
5.3.160.0050.03212.75
5.3.150.0070.03012.62
5.3.140.0100.03012.51
5.3.130.0060.04312.56
5.3.120.0030.03312.51
5.3.110.0050.03212.56
5.3.100.0080.03512.29
5.3.90.0070.03512.45
5.3.80.0110.03112.21
5.3.70.0070.04012.26
5.3.60.0070.03712.24
5.3.50.0150.02212.28
5.3.40.0090.03012.34
5.3.30.0130.03012.32
5.3.20.0110.02512.18
5.3.10.0100.03512.08
5.3.00.0080.02511.95
5.2.170.0000.06011.25
5.2.160.0030.05311.35
5.2.150.0100.05011.29
5.2.140.0100.06011.25
5.2.130.0130.03311.12
5.2.120.0000.06311.21
5.2.110.0100.04011.21
5.2.100.0100.05311.31
5.2.90.0030.04311.31
5.2.80.0070.05311.09
5.2.70.0030.04711.19
5.2.60.0070.04011.04
5.2.50.0070.04311.12
5.2.40.0130.04710.95
5.2.30.0200.05011.00
5.2.20.0070.05711.08
5.2.10.0030.04310.97
5.2.00.0100.04010.93
5.1.60.0070.04310.09
5.1.50.0000.04010.18
5.1.40.0070.04010.01
5.1.30.0030.04710.58
5.1.20.0030.05710.54
5.1.10.0170.03010.09
5.1.00.0130.0339.94
5.0.50.0130.0308.57
5.0.40.0100.0308.27
5.0.30.0100.0508.26
5.0.20.0070.0338.19
5.0.10.0070.0238.25
5.0.00.0030.0438.29
4.4.90.0100.0276.04
4.4.80.0000.0336.04
4.4.70.0130.0136.04
4.4.60.0070.0206.04
4.4.50.0030.0236.04
4.4.40.0070.0436.04
4.4.30.0100.0206.04
4.4.20.0030.0276.03
4.4.10.0000.0306.03
4.4.00.0070.0306.03
4.3.110.0000.0336.02
4.3.100.0070.0206.02
4.3.90.0030.0276.02
4.3.80.0100.0276.02
4.3.70.0030.0306.02
4.3.60.0030.0206.02
4.3.50.0030.0236.02
4.3.40.0030.0436.02
4.3.30.0100.0206.02
4.3.20.0000.0276.02
4.3.10.0000.0306.02
4.3.00.0130.0206.03

preferences:
26.85 ms | 401 KiB | 5 Q