3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Products{ // Properties protected $_title; protected $_category; // Methods public function __construct($title, $category){ $this->_title = $title; $this->_category = $category; } public function getCategory(){ return $this->_category; } public function getTitle(){ return $this->_title; } } class Order extends Products{ // Properties protected $_price; protected $_deliver; // Methods public function __construct($title, $category, $price){ parent::__construct($title, $category); $this->_price = $price; $this->freeDomesticShipment(); // method called (in this case a protected method, so only reachable from whitin the class. Could also have been private.) } public function getPrice(){ return $this->_price; } public function getDeliver(){ return $this->_deliver; } protected function freeDomesticShipment(){ $this->_deliver = $this->_price > 30 ? 'Yes' : 'No' ; } } $order = new Order('CD Brahms', 'Media', '45'); echo 'Product: '.$order->getTitle(); echo 'Categorie: '.$order->getCategory(); echo 'Prijs: '.$order->getPrice(); echo 'Gratis bezorging: '.$order->getDeliver();

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.70.0150.00618.56
8.3.60.0110.00416.25
8.3.50.0120.00721.18
8.3.40.0080.00818.66
8.3.30.0090.00919.04
8.3.20.0040.00420.34
8.3.10.0040.00423.48
8.3.00.0040.00419.38
8.2.180.0080.00816.75
8.2.170.0170.00322.96
8.2.160.0120.00920.39
8.2.150.0120.00324.18
8.2.140.0080.00024.66
8.2.130.0090.00026.16
8.2.120.0080.00022.21
8.2.110.0030.00622.15
8.2.100.0100.00617.91
8.2.90.0000.00819.27
8.2.80.0080.00017.97
8.2.70.0080.00017.75
8.2.60.0040.00418.04
8.2.50.0000.00818.07
8.2.40.0040.00419.82
8.2.30.0090.00019.72
8.2.20.0000.00717.53
8.2.10.0040.00418.09
8.2.00.0040.00717.72
8.1.280.0070.00725.92
8.1.270.0080.00023.80
8.1.260.0030.00626.35
8.1.250.0000.00728.09
8.1.240.0040.00423.86
8.1.230.0040.00819.12
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0000.01017.35
8.1.190.0080.00017.35
8.1.180.0050.00519.01
8.1.170.0030.00618.59
8.1.160.0040.00422.04
8.1.150.0030.00618.67
8.1.140.0040.00417.35
8.1.130.0000.00717.86
8.1.120.0070.00017.49
8.1.110.0040.00417.46
8.1.100.0070.00317.46
8.1.90.0000.00717.47
8.1.80.0000.00817.38
8.1.70.0030.00317.46
8.1.60.0030.00617.61
8.1.50.0000.00817.47
8.1.40.0040.00417.61
8.1.30.0050.00317.60
8.1.20.0040.00417.67
8.1.10.0040.00417.55
8.1.00.0060.00317.54
8.0.300.0040.00420.61
8.0.290.0070.00017.18
8.0.280.0070.00018.40
8.0.270.0030.00317.29
8.0.260.0000.00617.35
8.0.250.0030.00316.99
8.0.240.0030.00316.96
8.0.230.0030.00316.96
8.0.220.0030.00316.90
8.0.210.0040.00416.95
8.0.200.0030.00317.02
8.0.190.0060.00316.95
8.0.180.0040.00416.85
8.0.170.0050.00316.96
8.0.160.0050.00316.91
8.0.150.0040.00416.77
8.0.140.0000.00716.91
8.0.130.0030.00313.28
8.0.120.0040.00416.88
8.0.110.0000.00716.83
8.0.100.0070.00016.96
8.0.90.0000.00816.79
8.0.80.0070.00716.86
8.0.70.0040.00416.98
8.0.60.0040.00416.91
8.0.50.0030.00316.74
8.0.30.0090.01417.12
8.0.20.0100.00817.40
8.0.10.0000.00717.10
8.0.00.0050.01616.67
7.4.330.0050.00015.16
7.4.320.0000.00616.55
7.4.300.0030.00316.55
7.4.290.0000.00716.51
7.4.280.0040.00416.53
7.4.270.0030.00316.39
7.4.260.0030.00316.44
7.4.250.0040.00416.60
7.4.240.0020.00516.50
7.4.230.0000.00716.29
7.4.220.0140.00716.67
7.4.210.0060.01016.54
7.4.200.0050.00216.61
7.4.190.0070.00016.55
7.4.160.0130.00316.54
7.4.150.0110.01117.40
7.4.140.0110.00817.86
7.4.130.0090.00816.61
7.4.120.0070.01016.62
7.4.110.0030.01416.54
7.4.100.0090.01216.50
7.4.90.0090.00916.50
7.4.80.0060.01219.39
7.4.70.0060.01116.65
7.4.60.0070.01016.52
7.4.50.0000.00816.34
7.4.40.0070.01122.77
7.4.30.0100.00616.46
7.4.00.0080.01014.83
7.3.330.0030.00313.34
7.3.320.0000.00613.17
7.3.310.0040.00416.09
7.3.300.0050.00216.25
7.3.290.0070.00716.32
7.3.280.0080.00816.29
7.3.270.0150.00317.40
7.3.260.0080.00816.39
7.3.250.0110.00616.48
7.3.240.0030.01716.32
7.3.230.0130.00316.57
7.3.210.0090.00816.30
7.3.200.0130.01119.39
7.3.190.0160.00616.55
7.3.180.0070.01016.41
7.3.170.0100.01316.59
7.3.160.0000.01616.43
7.3.120.0070.00814.78
7.3.110.0110.00714.63
7.3.100.0070.00714.62
7.3.90.0070.00714.95
7.3.80.0060.01014.79
7.3.70.0000.01314.73
7.3.60.0090.00614.68
7.3.50.0070.00714.96
7.3.40.0130.00414.66
7.3.30.0050.00814.86
7.3.20.0040.01516.79
7.3.10.0080.00816.80
7.3.00.0030.01016.61
7.2.330.0100.00716.70
7.2.320.0000.01616.73
7.2.310.0070.01016.69
7.2.300.0140.00316.45
7.2.290.0100.01316.59
7.2.250.0100.00715.05
7.2.240.0100.01015.07
7.2.230.0070.01115.00
7.2.220.0060.00715.00
7.2.210.0050.00515.05
7.2.200.0060.00914.72
7.2.190.0110.00615.25
7.2.180.0070.00715.11
7.2.170.0060.01415.15
7.2.60.0030.01316.68
7.2.00.0120.00819.36
7.1.330.0080.00815.96
7.1.320.0040.01115.74
7.1.310.0270.00315.45
7.1.300.0000.01315.72
7.1.290.0070.01015.95
7.1.280.0070.01115.55
7.1.270.0130.00715.68
7.1.260.0050.01015.60
7.1.200.0110.00715.78
7.1.100.0030.01017.98
7.1.70.0090.00317.25
7.1.60.0100.00719.46
7.1.50.0140.01016.93
7.1.00.0070.07722.33
7.0.200.0000.00816.62
7.0.140.0070.07321.96
7.0.60.0070.08019.99
7.0.50.0070.06017.73
7.0.40.0030.08720.15
7.0.30.0170.04320.10
7.0.20.0430.03720.30
7.0.10.0170.05320.26
7.0.00.0030.08720.11
5.6.280.0070.07021.04
5.6.210.0030.04320.70
5.6.200.0030.07318.29
5.6.190.0030.09320.77
5.6.180.0300.06020.33
5.6.170.0330.03720.71
5.6.160.0070.07720.43
5.6.150.0100.05318.21
5.6.140.0070.07318.15
5.6.130.0070.08318.15
5.6.120.0000.04721.09
5.6.110.0070.05721.04
5.6.100.0030.04321.05
5.6.90.0170.07321.11
5.6.80.0070.03720.52
5.6.70.4400.04020.44
5.5.350.0030.08720.34
5.5.340.0030.04317.98
5.5.330.0100.07320.53
5.5.320.0200.04320.42
5.5.310.0230.07320.31
5.5.300.0100.05317.97
5.5.290.0100.05318.08
5.5.280.0100.08020.89
5.5.270.0130.07720.88
5.5.260.0200.07020.97
5.5.250.0100.08320.67
5.5.240.0100.05020.27
5.4.450.0870.05719.53
5.4.440.0800.05319.18
5.4.430.0070.06019.59
5.4.420.1000.04719.46
5.4.410.0670.05319.40
5.4.400.0570.04719.27
5.4.390.0300.04319.25
5.4.380.0300.05318.63
5.4.370.0330.06018.57
5.4.360.0470.05718.56
5.4.350.0400.07718.74
5.4.340.0300.05718.79
5.4.320.0070.03512.51
5.4.310.0080.03512.51
5.4.300.0080.03412.51
5.4.290.0110.05412.49
5.4.280.0090.05712.39
5.4.270.0050.06312.39
5.4.260.0080.05412.39
5.4.250.0090.04112.39
5.4.240.0060.04712.39
5.4.230.0080.05112.39
5.4.220.0080.05512.38
5.4.210.0090.05012.38
5.4.200.0070.05312.39
5.4.190.0130.05212.38
5.4.180.0090.05212.38
5.4.170.0050.04012.39
5.4.160.0100.03712.39
5.4.150.0050.06212.38
5.4.140.0090.03912.07
5.4.130.0080.03512.05
5.4.120.0080.03412.01
5.4.110.0080.03512.00
5.4.100.0050.04912.00
5.4.90.0090.04812.01
5.4.80.0040.04112.01
5.4.70.0080.03512.01
5.4.60.0060.03512.00
5.4.50.0080.03812.00
5.4.40.0060.03811.99
5.4.30.0070.03511.99
5.4.20.0090.03411.99
5.4.10.0070.03611.99
5.4.00.0070.05111.48
5.3.290.0050.04712.80
5.3.280.0050.05412.71
5.3.270.0110.04512.73
5.3.260.0090.04412.71
5.3.250.0070.03912.71
5.3.240.0070.03712.72
5.3.230.0030.04012.71
5.3.220.0050.04012.68
5.3.210.0080.04012.68
5.3.200.0100.03412.68
5.3.190.0070.03912.68
5.3.180.0070.04312.67
5.3.170.0100.05012.67
5.3.160.0080.03812.68
5.3.150.0040.04212.67
5.3.140.0080.03912.66
5.3.130.0110.05012.66
5.3.120.0130.05612.66
5.3.110.0070.05812.66
5.3.100.0100.06212.13
5.3.90.0120.06412.13
5.3.80.0060.05512.11
5.3.70.0060.05112.12
5.3.60.0080.05412.09
5.3.50.0090.05012.04
5.3.40.0080.04812.04
5.3.30.0070.05512.00
5.3.20.0090.04011.78
5.3.10.0070.05311.74
5.3.00.0080.06011.73
5.2.170.0090.0459.23
5.2.160.0120.0409.23
5.2.150.0050.0359.23
5.2.140.0050.0469.23
5.2.130.0050.0399.19
5.2.120.0130.0669.19
5.2.110.0090.0349.20
5.2.100.0080.0299.19
5.2.90.0090.0429.19
5.2.80.0070.0429.18
5.2.70.0110.0289.19
5.2.60.0070.0509.14
5.2.50.0050.0429.11
5.2.40.0090.0369.09
5.2.30.0090.0379.06
5.2.20.0060.0429.05
5.2.10.0060.0398.96
5.2.00.0050.0438.82
5.1.60.0050.0368.11
5.1.50.0030.0308.10
5.1.40.0030.0278.08
5.1.30.0070.0268.43
5.1.20.0110.0298.45
5.1.10.0110.0258.18
5.1.00.0060.0398.18
5.0.50.0050.0286.66
5.0.40.0040.0296.52
5.0.30.0090.0346.33
5.0.20.0060.0226.29
5.0.10.0060.0266.27
5.0.00.0060.0366.26
4.4.90.0040.0224.78
4.4.80.0060.0254.75
4.4.70.0100.0214.75
4.4.60.0040.0264.75
4.4.50.0050.0274.77
4.4.40.0100.0684.71
4.4.30.0060.0374.76
4.4.20.0060.0254.85
4.4.10.0050.0294.85
4.4.00.0080.0394.76
4.3.110.0060.0264.67
4.3.100.0040.0304.67
4.3.90.0050.0244.63
4.3.80.0050.0374.58
4.3.70.0040.0294.63
4.3.60.0070.0204.63
4.3.50.0040.0224.63
4.3.40.0040.0344.53
4.3.30.0040.0223.30
4.3.20.0030.0233.28
4.3.10.0030.0243.23
4.3.00.0200.02310.54

preferences:
30.29 ms | 401 KiB | 5 Q