3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Product { /* Static Methos and Properties example */ public static $manufacturer = "Bart Taylor"; public $name = 'default_name'; public $price = 0; public $desc = 'default description'; function __construct($name, $price, $desc){ $this->name = $name; $this->price = $price; $this->desc = $desc; } public function getInfo(){ return "Product Name: ". $this->name; } public function getMaker(){ return self::$manufacturer; } } /* Part on Object Inheritance */ //SUB-CLASS class Soda extends Product { public $flavor; function __construct($name, $price, $desc, $flavor){ parent::__construct($name, $price, $desc); $this->favor = $flavor; } public function getInfo(){ return "Product Name: ". $this->name . "Flavor: ". $this->flavor; } } $shirt = new Product("Space Juice T-Shirt", 20, "Awesome Grey T-Shirt");

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.00716.63
8.3.50.0100.01022.04
8.3.40.0070.01118.81
8.3.30.0040.01118.92
8.3.20.0000.00720.34
8.3.10.0040.00423.48
8.3.00.0030.00520.96
8.2.180.0110.00716.75
8.2.170.0090.00922.96
8.2.160.0070.00720.38
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0080.00020.87
8.2.110.0030.00622.31
8.2.100.0040.00817.78
8.2.90.0000.00822.15
8.2.80.0000.00817.97
8.2.70.0050.00317.90
8.2.60.0030.00617.89
8.2.50.0040.00418.10
8.2.40.0000.00822.03
8.2.30.0030.00518.27
8.2.20.0000.00717.63
8.2.10.0070.00018.01
8.2.00.0000.00817.65
8.1.280.0200.00025.92
8.1.270.0050.00523.83
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0050.00522.42
8.1.230.0040.00820.89
8.1.220.0040.00417.74
8.1.210.0000.00918.87
8.1.200.0060.00317.35
8.1.190.0040.00417.25
8.1.180.0000.00918.10
8.1.170.0090.00018.59
8.1.160.0070.00022.02
8.1.150.0030.00518.59
8.1.140.0040.00417.32
8.1.130.0070.00017.89
8.1.120.0000.00817.31
8.1.110.0040.00417.43
8.1.100.0090.00017.45
8.1.90.0040.00417.39
8.1.80.0040.00417.32
8.1.70.0000.00717.40
8.1.60.0000.00717.60
8.1.50.0040.00417.40
8.1.40.0000.00717.60
8.1.30.0000.00817.65
8.1.20.0020.00517.60
8.1.10.0000.00717.52
8.1.00.0030.00517.35
8.0.300.0030.00619.96
8.0.290.0040.00416.63
8.0.280.0070.00018.40
8.0.270.0030.00317.13
8.0.260.0030.00317.26
8.0.250.0030.00316.90
8.0.240.0000.00816.80
8.0.230.0000.00716.88
8.0.220.0000.00716.75
8.0.210.0030.00316.72
8.0.200.0000.00616.82
8.0.190.0000.00716.89
8.0.180.0000.00716.86
8.0.170.0000.00716.78
8.0.160.0040.00416.79
8.0.150.0040.00416.66
8.0.140.0000.00716.80
8.0.130.0000.00613.27
8.0.120.0040.00416.87
8.0.110.0030.00616.71
8.0.100.0000.00716.80
8.0.90.0050.00216.92
8.0.80.0140.00816.84
8.0.70.0040.00416.63
8.0.60.0070.00016.91
8.0.50.0040.00416.90
8.0.30.0110.00717.13
8.0.20.0120.01117.40
8.0.10.0040.00416.98
8.0.00.0070.01016.80
7.4.330.0060.00015.00
7.4.320.0040.00416.61
7.4.300.0030.00316.39
7.4.290.0030.00316.67
7.4.280.0070.00016.65
7.4.270.0020.00516.48
7.4.260.0050.00316.47
7.4.250.0050.00216.59
7.4.240.0000.00716.62
7.4.230.0040.00416.71
7.4.220.0120.00616.67
7.4.210.0100.00816.66
7.4.200.0070.00016.60
7.4.190.0000.00816.71
7.4.160.0070.01016.49
7.4.150.0070.01017.40
7.4.140.0080.01117.86
7.4.130.0080.01216.43
7.4.120.0080.01016.48
7.4.110.0100.00716.41
7.4.100.0070.01016.41
7.4.90.0030.01316.34
7.4.80.0070.01119.39
7.4.70.0070.01016.57
7.4.60.0100.00716.45
7.4.50.0060.00316.48
7.4.40.0100.01016.59
7.4.30.0120.00316.64
7.4.00.0050.01114.86
7.3.330.0060.00013.32
7.3.320.0060.00013.25
7.3.310.0050.00216.27
7.3.300.0070.00016.06
7.3.290.0110.00816.31
7.3.280.0070.01416.26
7.3.270.0140.01017.40
7.3.260.0070.01016.31
7.3.250.0120.00816.22
7.3.240.0090.00916.48
7.3.230.0070.01516.39
7.3.210.0130.01316.49
7.3.200.0060.01019.39
7.3.190.0130.00316.43
7.3.180.0130.00316.24
7.3.170.0030.01316.53
7.3.160.0040.01216.18
7.3.120.0070.00914.63
7.3.110.0070.01014.70
7.3.100.0070.01014.77
7.3.90.0070.00714.75
7.3.80.0090.00614.88
7.3.70.0030.01314.88
7.3.60.0040.01114.79
7.3.50.0070.01014.93
7.3.40.0030.01014.66
7.3.30.0100.00314.62
7.3.20.0100.00316.68
7.3.10.0070.00716.34
7.3.00.0100.00316.35
7.2.330.0060.01216.79
7.2.320.0170.00916.50
7.2.310.0030.01416.72
7.2.300.0060.01016.38
7.2.290.0130.01016.71
7.2.250.0030.00914.90
7.2.240.0080.00814.63
7.2.230.0080.00615.14
7.2.220.0030.00615.01
7.2.210.0030.01415.04
7.2.200.0070.00414.89
7.2.190.0060.00915.12
7.2.180.0100.00315.08
7.2.170.0070.00415.05
7.2.00.0000.01118.96
7.1.330.0080.00415.49
7.1.320.0040.01115.55
7.1.310.0060.01015.53
7.1.300.0100.00615.66
7.1.290.0060.00615.55
7.1.280.0090.00615.54
7.1.270.0110.00315.88
7.1.260.0120.00315.71
7.1.200.0000.01115.61
7.1.100.0050.00518.26
7.1.70.0000.00917.07
7.1.60.0140.01019.46
7.1.50.0070.01016.86
7.1.00.0000.08022.31
7.0.200.0000.00816.52
7.0.140.0070.07022.14
7.0.60.0170.07019.98
7.0.50.0070.06717.84
7.0.40.0100.06720.36
7.0.30.0230.07720.16
7.0.20.0100.04720.06
7.0.10.0030.06720.07
7.0.00.0000.04320.23
5.6.280.0070.06720.92
5.6.210.0130.08020.57
5.6.200.0000.08718.25
5.6.190.0100.07020.50
5.6.180.3670.04720.63
5.6.170.0230.04320.71
5.6.160.0070.08320.55
5.6.150.0130.05718.12
5.6.140.0000.06018.16
5.6.130.0130.04718.28
5.6.120.0070.06021.01
5.6.110.0170.06021.15
5.6.100.0030.04020.89
5.6.90.0070.04720.98
5.6.80.0030.06020.38
5.6.70.4630.04320.44
5.5.350.0030.09020.47
5.5.340.0000.04318.04
5.5.330.0200.07320.42
5.5.320.0400.03720.27
5.5.310.0300.07320.29
5.5.300.0100.07717.95
5.5.290.0000.05018.03
5.5.280.0000.05021.00
5.5.270.0130.05720.89
5.5.260.0200.07020.90
5.5.250.0070.05020.68
5.5.240.0070.07720.29
5.4.450.0600.04319.28
5.4.440.1130.04319.57
5.4.430.0700.04319.63
5.4.420.0330.03719.45
5.4.410.0630.05019.28
5.4.400.0200.05319.01
5.4.390.0570.04719.15
5.4.380.0400.05718.75
5.4.370.0470.05718.77
5.4.360.0300.05318.77
5.4.350.0400.06018.70
5.4.340.0330.05318.74
5.4.320.0070.04412.51
5.4.310.0080.03912.51
5.4.300.0070.03812.51
5.4.290.0070.04012.50
5.4.280.0050.03712.40
5.4.270.0070.03712.40
5.4.260.0100.03612.40
5.4.250.0070.03912.40
5.4.240.0060.04012.40
5.4.230.0050.04012.39
5.4.220.0040.03812.40
5.4.210.0060.04012.39
5.4.200.0080.03912.39
5.4.190.0070.03912.39
5.4.180.0110.03512.39
5.4.170.0050.04012.40
5.4.160.0080.03712.40
5.4.150.0080.03812.39
5.4.140.0090.03812.08
5.4.130.0040.03912.07
5.4.120.0070.03712.02
5.4.110.0100.03612.02
5.4.100.0080.03512.02
5.4.90.0050.03912.02
5.4.80.0060.03912.02
5.4.70.0100.03312.02
5.4.60.0070.03512.02
5.4.50.0050.03812.02
5.4.40.0090.04312.00
5.4.30.0100.03912.00
5.4.20.0120.03312.00
5.4.10.0090.03712.00
5.4.00.0090.03711.49
5.3.290.0110.04612.80
5.3.280.0060.04312.71
5.3.270.0090.04612.73
5.3.260.0080.04512.71
5.3.250.0090.04512.72
5.3.240.0100.04012.72
5.3.230.0070.04712.71
5.3.220.0100.04412.68
5.3.210.0050.04612.68
5.3.200.0100.04412.68
5.3.190.0060.04212.68
5.3.180.0070.04212.67
5.3.170.0060.04212.67
5.3.160.0110.04712.68
5.3.150.0120.04812.67
5.3.140.0100.04012.66
5.3.130.0070.04412.66
5.3.120.0050.04412.66
5.3.110.0070.04512.66
5.3.100.0120.03812.13
5.3.90.0080.04112.11
5.3.80.0090.03912.10
5.3.70.0040.04412.10
5.3.60.0080.04912.09
5.3.50.0080.04812.04
5.3.40.0040.05112.04
5.3.30.0060.04911.99
5.3.20.0110.04311.77
5.3.10.0060.04411.74
5.3.00.0110.05511.73
5.2.170.0060.0339.23
5.2.160.0040.0329.23
5.2.150.0040.0349.23
5.2.140.0040.0389.23
5.2.130.0090.0649.19
5.2.120.0060.0389.19
5.2.110.0070.0299.20
5.2.100.0050.0309.18
5.2.90.0040.0319.19
5.2.80.0040.0329.18
5.2.70.0050.0309.18
5.2.60.0060.0349.14
5.2.50.0030.0339.10
5.2.40.0040.0319.08
5.2.30.0060.0319.06
5.2.20.0010.0349.05
5.2.10.0040.0298.95
5.2.00.0060.0288.82
5.1.60.0040.0258.10
5.1.50.0060.0268.09
5.1.40.0060.0358.08
5.1.30.0050.0388.42
5.1.20.0060.0388.45
5.1.10.0050.0328.17
5.1.00.0050.0278.17
5.0.50.0040.0216.65
5.0.40.0030.0206.51
5.0.30.0040.0316.32
5.0.20.0050.0186.29
5.0.10.0010.0226.27
5.0.00.0060.0286.27
4.4.90.0020.0184.78
4.4.80.0070.0214.76
4.4.70.0040.0204.75
4.4.60.0070.0204.75
4.4.50.0110.0224.77
4.4.40.0070.0214.71
4.4.30.0020.0184.76
4.4.20.0040.0164.85
4.4.10.0050.0184.85
4.4.00.0040.0334.76
4.3.110.0060.0144.66
4.3.100.0050.0214.66
4.3.90.0060.0194.63
4.3.80.0030.0314.59
4.3.70.0040.0224.63
4.3.60.0080.0304.63
4.3.50.0030.0194.63
4.3.40.0040.0244.54
4.3.30.0050.0153.30
4.3.20.0020.0183.28
4.3.10.0020.0193.23
4.3.00.0000.01316.14

preferences:
36.95 ms | 401 KiB | 5 Q