3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Products{ protected $_title; protected $_category; protected $_price; public function __construct($title, $category, $price){ if($price < 0){ throw new Exception('Price must be a positive number'); } $this->_title = $title; $this->_category = $category; $this->_price = $price; } public function getTitle(){ return $this->_title; } public function getCategory(){ return $this->_category; } public function getPrice(){ return $this->_price; } } $product = new Products('Title', 'Category', -45); echo $product->getPrice();

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.0090.00918.56
8.3.50.0140.00321.97
8.3.40.0100.00718.84
8.3.30.0000.01419.22
8.3.20.0040.00419.91
8.3.10.0080.00021.89
8.3.00.0030.00522.32
8.2.180.0070.01116.47
8.2.170.0070.00722.96
8.2.160.0000.01419.15
8.2.150.0000.00824.18
8.2.140.0070.00024.66
8.2.130.0070.00026.16
8.2.120.0000.00819.36
8.2.110.0090.00022.25
8.2.100.0080.00317.84
8.2.90.0080.00019.22
8.2.80.0050.00519.66
8.2.70.0000.00817.63
8.2.60.0030.00517.91
8.2.50.0080.00018.07
8.2.40.0030.00618.03
8.2.30.0060.00318.02
8.2.20.0000.00717.77
8.2.10.0080.00019.54
8.2.00.0040.00417.73
8.1.280.0070.00725.92
8.1.270.0050.00522.04
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.79
8.1.230.0120.00019.01
8.1.220.0000.00817.78
8.1.210.0060.00318.77
8.1.200.0000.01117.22
8.1.190.0040.00417.43
8.1.180.0040.00418.10
8.1.170.0060.00318.47
8.1.160.0000.01022.08
8.1.150.0000.00718.50
8.1.140.0080.00017.41
8.1.130.0050.00217.68
8.1.120.0070.00017.42
8.1.110.0000.00717.41
8.1.100.0040.00417.41
8.1.90.0040.00417.36
8.1.80.0000.00717.41
8.1.70.0070.00017.38
8.1.60.0030.00617.54
8.1.50.0000.00817.48
8.1.40.0000.00717.45
8.1.30.0070.00017.57
8.1.20.0000.00817.64
8.1.10.0000.00717.53
8.1.00.0030.00617.43
8.0.300.0030.00318.77
8.0.290.0000.00717.05
8.0.280.0000.00718.30
8.0.270.0030.00317.08
8.0.260.0030.00316.83
8.0.250.0100.00016.97
8.0.240.0040.00417.02
8.0.230.0030.00316.86
8.0.220.0000.00716.93
8.0.210.0040.00416.80
8.0.200.0000.00716.82
8.0.190.0050.00216.96
8.0.180.0020.00516.81
8.0.170.0040.00416.91
8.0.160.0000.00716.87
8.0.150.0070.00016.77
8.0.140.0040.00416.92
8.0.130.0060.00013.48
8.0.120.0030.00516.88
8.0.110.0040.00416.94
8.0.100.0040.00416.99
8.0.90.0000.00716.77
8.0.80.0090.00616.99
8.0.70.0000.00816.85
8.0.60.0000.00816.94
8.0.50.0020.00516.74
8.0.30.0110.00917.00
8.0.20.0110.00717.40
8.0.10.0040.00416.86
8.0.00.0130.00516.84
7.4.330.0050.00015.00
7.4.320.0070.00016.47
7.4.300.0060.00016.45
7.4.290.0030.00316.40
7.4.280.0040.00416.50
7.4.270.0040.00416.42
7.4.260.0080.00016.54
7.4.250.0000.00816.39
7.4.240.0040.00316.45
7.4.230.0030.00316.62
7.4.220.0060.01116.32
7.4.210.0050.01216.62
7.4.200.0030.00316.56
7.4.190.0050.00216.62
7.4.160.0060.00916.43
7.4.150.0130.00317.40
7.4.140.0080.01017.86
7.4.130.0100.01016.58
7.4.120.0090.00816.52
7.4.110.0110.00716.59
7.4.100.0080.00816.50
7.4.90.0130.00716.52
7.4.80.0060.01219.39
7.4.70.0030.01416.55
7.4.60.0080.00816.59
7.4.50.0050.00316.35
7.4.40.0120.00322.77
7.4.30.0100.00616.68
7.4.00.0070.01014.88
7.3.330.0020.00213.17
7.3.320.0030.00313.38
7.3.310.0070.00016.39
7.3.300.0030.00316.32
7.3.290.0030.01216.39
7.3.280.0120.00616.38
7.3.270.0140.00317.40
7.3.260.0040.01616.43
7.3.250.0170.00016.45
7.3.240.0100.00716.55
7.3.230.0130.00416.39
7.3.210.0140.00216.55
7.3.200.0120.00619.39
7.3.190.0150.01016.37
7.3.180.0100.00716.48
7.3.170.0080.00916.54
7.3.160.0100.01316.48
7.3.120.0070.01014.77
7.3.00.0090.00516.64
7.2.330.0100.00716.37
7.2.320.0120.01116.85
7.2.310.0100.00716.64
7.2.300.0060.01016.73
7.2.290.0110.00816.49
7.2.130.0070.00516.80
7.2.120.0110.00316.76
7.2.110.0050.00916.85
7.2.100.0050.01016.75
7.2.90.0050.00616.78
7.2.80.0080.00616.69
7.2.70.0020.00816.64
7.2.60.0040.00916.90
7.2.50.0070.00716.85
7.2.40.0020.01016.75
7.2.30.0000.01316.89
7.2.20.0040.01116.77
7.2.10.0060.00416.77
7.2.00.0080.00817.75
7.1.250.0070.00915.79
7.1.240.0100.00715.76
7.1.230.0040.00815.74
7.1.220.0080.00615.61
7.1.210.0070.00715.53
7.1.200.0080.00415.62
7.1.190.0050.00815.66
7.1.180.0020.01215.82
7.1.170.0050.00915.67
7.1.160.0100.00315.56
7.1.150.0080.00315.79
7.1.140.0010.00915.69
7.1.130.0060.00915.82
7.1.120.0110.00515.73
7.1.110.0080.00715.50
7.1.100.0070.00816.55
7.1.90.0080.00715.55
7.1.80.0050.00715.79
7.1.70.0010.01216.25
7.1.60.0060.01017.15
7.1.50.0050.00516.19
7.1.40.0050.00515.61
7.1.30.0090.00115.62
7.1.20.0050.00815.59
7.1.10.0000.01215.58
7.1.00.0060.02817.82
7.0.330.0070.00615.47
7.0.320.0050.00915.25
7.0.310.0040.00715.38
7.0.300.0080.00715.41
7.0.290.0030.00915.27
7.0.280.0060.00815.43
7.0.270.0070.00415.23
7.0.260.0100.00515.42
7.0.250.0030.00715.38
7.0.240.0080.00615.49
7.0.230.0130.00415.32
7.0.220.0020.00715.39
7.0.210.0050.00915.47
7.0.200.0080.00415.96
7.0.190.0020.01215.34
7.0.180.0070.00815.47
7.0.170.0070.00515.56
7.0.160.0050.00515.30
7.0.150.0000.01215.13
7.0.140.0080.02517.56
7.0.130.0090.00115.35
7.0.120.0030.00915.15
7.0.110.0050.00615.37
7.0.100.0100.02916.98
7.0.90.0050.02416.85
7.0.80.0050.01716.91
7.0.70.0050.02416.76
7.0.60.0090.01916.90
7.0.50.0050.01917.23
7.0.40.0040.02015.63
7.0.30.0040.02015.71
7.0.20.0070.01715.48
7.0.10.0020.01915.65
7.0.00.0060.02315.57
5.6.380.0110.00314.23
5.6.370.0060.00614.32
5.6.360.0030.00814.07
5.6.350.0080.00514.35
5.6.340.0050.00614.23
5.6.330.0020.01214.09
5.6.320.0030.00814.26
5.6.310.0050.00314.29
5.6.300.0030.00914.13
5.6.290.0060.00614.13
5.6.280.0030.02916.62
5.6.270.0090.00314.38
5.6.260.0110.00214.11
5.6.250.0050.02116.38
5.6.240.0070.03016.44
5.6.230.0080.03316.34
5.6.220.0060.01716.26
5.6.210.0060.01816.42
5.6.200.0060.03416.57
5.6.190.0040.02116.55
5.6.180.0040.02216.45
5.6.170.0070.01716.61
5.6.160.0080.01716.60
5.6.150.0070.01716.42
5.6.140.0020.02016.72
5.6.130.0050.02316.41
5.6.120.0060.01916.55
5.6.110.0050.02516.50
5.6.100.0070.02716.48
5.6.90.0100.03216.50
5.6.80.0080.03116.38
5.6.70.0050.03116.21
5.6.60.0050.01916.27
5.6.50.0040.03216.29
5.6.40.0120.02616.27
5.6.30.0090.03016.08
5.6.20.0060.02816.34
5.6.10.0080.01816.21
5.6.00.0080.02716.21
5.5.380.0060.02814.31
5.5.370.0050.01514.37
5.5.360.0040.01814.20
5.5.350.0050.01614.18
5.5.340.0050.01714.58
5.5.330.0070.02414.40
5.5.320.0040.01814.45
5.5.310.0050.01714.32
5.5.300.0000.02314.48
5.5.290.0020.02014.40
5.5.280.0020.02214.35
5.5.270.0050.03014.44
5.5.260.0070.02714.29
5.5.250.0070.02914.27
5.5.240.0030.02914.26
5.5.230.0070.01814.12
5.5.220.0030.02514.11
5.5.210.0030.02614.15
5.5.200.0080.02514.02
5.5.190.0040.03014.24
5.5.180.0020.03314.16
5.5.170.0070.00511.24
5.5.160.0030.02814.11
5.5.150.0050.02414.20
5.5.140.0030.02314.13
5.5.130.0060.02814.05
5.5.120.0080.02614.15
5.5.110.0060.03113.96
5.5.100.0030.01914.01
5.5.90.0030.03214.02
5.5.80.0030.02914.13
5.5.70.0060.02614.15
5.5.60.0060.02314.03
5.5.50.0070.02814.18
5.5.40.0060.02914.09
5.5.30.0050.02014.12
5.5.20.0060.02714.06
5.5.10.0100.02814.06
5.5.00.0060.02013.91
5.4.450.0080.02113.70
5.4.440.0040.01813.79
5.4.430.0030.02913.77
5.4.420.0060.03013.79
5.4.410.0040.02513.63
5.4.400.0060.02913.82
5.4.390.0100.02413.69
5.4.380.0020.01813.63
5.4.370.0030.03013.80
5.4.360.0020.03113.84
5.4.350.0050.02713.76
5.4.340.0060.02813.70
5.4.330.0070.00011.02
5.4.320.0060.03013.65
5.4.310.0070.02613.68
5.4.300.0040.03013.78
5.4.290.0080.02513.72
5.4.280.0010.03313.75
5.4.270.0070.02613.75
5.4.260.0050.03113.67
5.4.250.0080.02713.85
5.4.240.0090.02713.75
5.4.230.0050.02113.50
5.4.220.0050.03013.62
5.4.210.0050.02913.63
5.4.200.0040.03013.76
5.4.190.0030.03113.63
5.4.180.0050.02913.71
5.4.170.0050.03013.81
5.4.160.0060.02813.63
5.4.150.0070.02013.61
5.4.140.0060.02612.86
5.4.130.0080.02412.83
5.4.120.0050.02812.90
5.4.110.0030.02812.87
5.4.100.0040.02112.70
5.4.90.0050.02812.93
5.4.80.0040.02512.90
5.4.70.0090.02412.77
5.4.60.0060.02812.81
5.4.50.0040.01712.77
5.4.40.0060.02512.82
5.4.30.0060.02812.72
5.4.20.0020.03012.86
5.4.10.0030.02112.78
5.4.00.0030.02112.65
5.3.290.0070.02812.16
5.3.280.0080.02512.10
5.3.270.0040.02012.02
5.3.260.0040.02912.14
5.3.250.0040.03012.09
5.3.240.0050.02712.13
5.3.230.0030.02012.13
5.3.220.0080.02612.04
5.3.210.0050.02212.09
5.3.200.0020.02912.00
5.3.190.0060.02312.11
5.3.180.0080.02312.14
5.3.170.0060.01612.18
5.3.160.0070.02812.14
5.3.150.0070.01712.16
5.3.140.0040.01912.04
5.3.130.0060.02712.12
5.3.120.0100.02212.09
5.3.110.0050.02512.03
5.3.100.0040.02911.84
5.3.90.0070.02111.82
5.3.80.0060.02411.98
5.3.70.0060.02711.92
5.3.60.0050.02111.92
5.3.50.0060.02711.92
5.3.40.0040.02211.78
5.3.30.0030.01811.85
5.3.20.0050.01711.73
5.3.10.0030.02711.66
5.3.00.0060.02711.69
5.2.170.0040.02310.92
5.2.160.0010.02710.92
5.2.150.0030.02210.92
5.2.140.0020.02410.92
5.2.130.0050.02010.92
5.2.120.0050.02210.92
5.2.110.0040.02310.92
5.2.100.0050.02110.92
5.2.90.0020.02610.92
5.2.80.0020.02410.92
5.2.70.0020.02410.92
5.2.60.0070.02110.92
5.2.50.0070.02010.92
5.2.40.0040.02410.92
5.2.30.0060.02210.92
5.2.20.0040.02110.92
5.2.10.0070.01810.92
5.2.00.0080.01910.92
5.1.60.0030.02310.92
5.1.50.0040.02110.92
5.1.40.0050.01610.92
5.1.30.0050.01910.92
5.1.20.0050.02010.92
5.1.10.0020.02110.92
5.1.00.0020.02110.92
5.0.50.0030.01810.92
5.0.40.0020.01910.92
5.0.30.0030.01210.92
5.0.20.0020.01710.92
5.0.10.0060.01510.92
5.0.00.0010.01510.92
4.4.90.0020.01310.92
4.4.80.0010.01410.92
4.4.70.0050.01310.92
4.4.60.0010.01210.92
4.4.50.0010.01410.92
4.4.40.0020.01910.92
4.4.30.0040.01110.92
4.4.20.0020.01510.92
4.4.10.0010.02010.92
4.4.00.0040.01710.92
4.3.110.0020.01510.92
4.3.100.0010.01510.92
4.3.90.0020.01310.92
4.3.80.0020.01910.92
4.3.70.0020.01410.92
4.3.60.0000.01510.92
4.3.50.0030.01210.92
4.3.40.0050.01710.92
4.3.30.0010.01310.92
4.3.20.0030.00910.92
4.3.10.0030.01310.92
4.3.00.0020.01310.92

preferences:
39.06 ms | 401 KiB | 5 Q