3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Product{ public function GetName(); } class ConcreteProductA implements Product{ public function GetName() { return "ProductA"; } } class ConcreteProductB implements Product{ public function GetName() { return "ProductB"; } } interface Creator{ public function FactoryMethod(); } class ConcreteCreatorA implements Creator{ public function FactoryMethod() { return new ConcreteProductA(); } } class ConcreteCreatorB implements Creator{ public function FactoryMethod() { return new ConcreteProductB(); } } // An array of creators $creators = array( new ConcreteCreatorA(), new ConcreteCreatorB() ); // Iterate over creators and create products for($i = 0; $i < count($creators); $i++){ $products[] = $creators[$i]->FactoryMethod(); } header("content-type:text/plain"); echo var_export($products); ?>

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.0080.00816.50
8.3.50.0120.00821.21
8.3.40.0040.01118.88
8.3.30.0090.00618.98
8.3.20.0050.00320.17
8.3.10.0080.00023.70
8.3.00.0060.00319.25
8.2.180.0090.00618.18
8.2.170.0070.01422.96
8.2.160.0030.01420.22
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0130.00626.16
8.2.120.0000.00722.16
8.2.110.0090.00022.26
8.2.100.0060.00617.91
8.2.90.0030.00619.23
8.2.80.0080.00018.04
8.2.70.0030.00717.63
8.2.60.0000.00818.02
8.2.50.0040.00418.07
8.2.40.0040.00418.16
8.2.30.0000.00718.09
8.2.20.0000.00717.81
8.2.10.0080.00018.12
8.2.00.0060.00317.67
8.1.280.0070.01025.92
8.1.270.0000.00821.78
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0000.00823.93
8.1.230.0040.00819.16
8.1.220.0030.00517.74
8.1.210.0040.00418.77
8.1.200.0000.00917.25
8.1.190.0050.00317.53
8.1.180.0040.00418.10
8.1.170.0040.00418.50
8.1.160.0030.00321.93
8.1.150.0040.00418.64
8.1.140.0000.00717.49
8.1.130.0000.00817.89
8.1.120.0000.00717.48
8.1.110.0000.00817.42
8.1.100.0050.00217.28
8.1.90.0000.00717.31
8.1.80.0000.00717.30
8.1.70.0000.00717.44
8.1.60.0040.00417.44
8.1.50.0030.00517.41
8.1.40.0040.00417.43
8.1.30.0080.00017.63
8.1.20.0040.00417.64
8.1.10.0000.00717.61
8.1.00.0030.00517.53
8.0.300.0040.00418.77
8.0.290.0030.00617.04
8.0.280.0030.00318.51
8.0.270.0000.00717.32
8.0.260.0080.00017.26
8.0.250.0040.00416.99
8.0.240.0030.00317.02
8.0.230.0030.00316.95
8.0.220.0030.00316.89
8.0.210.0030.00316.88
8.0.200.0000.00616.86
8.0.190.0090.00016.94
8.0.180.0000.00816.94
8.0.170.0030.00616.94
8.0.160.0000.00716.81
8.0.150.0050.00216.95
8.0.140.0000.00716.86
8.0.130.0000.00513.29
8.0.120.0040.00416.79
8.0.110.0090.00016.91
8.0.100.0000.00716.93
8.0.90.0050.00316.92
8.0.80.0100.00716.85
8.0.70.0000.00816.73
8.0.60.0040.00416.96
8.0.50.0000.00816.91
8.0.30.0100.01017.23
8.0.20.0090.00917.40
8.0.10.0000.00816.96
8.0.00.0070.01216.85
7.4.330.0000.00615.00
7.4.320.0050.00316.52
7.4.300.0070.00016.52
7.4.290.0030.00316.59
7.4.280.0090.00016.62
7.4.270.0000.00716.55
7.4.260.0040.00316.48
7.4.250.0000.00816.45
7.4.240.0050.00216.65
7.4.230.0030.00316.62
7.4.220.0130.00316.58
7.4.210.0070.01016.59
7.4.200.0000.00716.50
7.4.190.0070.00016.47
7.4.160.0110.00516.43
7.4.150.0070.01017.40
7.4.140.0110.00817.86
7.4.130.0040.01716.63
7.4.120.0110.00516.47
7.4.110.0140.00316.52
7.4.100.0030.01616.52
7.4.90.0040.01416.43
7.4.80.0110.00819.39
7.4.70.0080.00916.59
7.4.60.0030.01316.55
7.4.50.0050.00316.37
7.4.40.0040.01422.77
7.4.30.0070.01016.44
7.4.00.0040.01114.90
7.3.330.0020.00313.35
7.3.320.0050.00013.36
7.3.310.0000.00816.20
7.3.300.0040.00316.20
7.3.290.0090.00616.33
7.3.280.0110.00416.31
7.3.270.0090.00917.40
7.3.260.0100.00716.47
7.3.250.0110.00716.47
7.3.240.0090.00916.41
7.3.230.0040.01216.39
7.3.210.0080.00816.33
7.3.200.0090.01319.39
7.3.190.0130.00716.52
7.3.180.0040.01116.46
7.3.170.0090.00616.45
7.3.160.0070.01016.46
7.3.120.0100.00715.11
7.2.330.0110.00716.47
7.2.320.0070.01116.85
7.2.310.0100.00616.61
7.2.300.0060.01016.70
7.2.290.0070.01016.61
7.1.70.0060.01317.03
7.1.60.0060.01919.33
7.1.50.0240.01434.60
7.1.00.0030.07722.35
7.0.200.0220.00614.72
7.0.140.0130.06322.09
7.0.60.0030.04319.84
7.0.50.0070.06717.92
7.0.40.0030.06320.05
7.0.30.0270.04020.08
7.0.20.0170.04020.06
7.0.10.0100.04320.12
7.0.00.0070.08320.16
5.6.280.0070.07021.04
5.6.210.0100.07720.51
5.6.200.0030.04318.15
5.6.190.0100.08720.51
5.6.180.0270.07720.61
5.6.170.0270.05320.45
5.6.160.0070.08320.63
5.6.150.0130.07718.27
5.6.140.0170.07318.15
5.6.130.0100.03718.19
5.6.120.0030.04021.15
5.6.110.0130.07321.11
5.6.100.0130.08020.97
5.6.90.0130.07721.00
5.6.80.0100.08320.30
5.6.70.0070.04020.36
5.5.350.0170.07320.34
5.5.340.0030.08018.09
5.5.330.0030.08720.40
5.5.320.0100.06020.32
5.5.310.0170.08320.30
5.5.300.0100.06018.04
5.5.290.0100.04318.08
5.5.280.0100.04320.82
5.5.270.0100.06020.82
5.5.260.0030.08320.77
5.5.250.0130.07720.70
5.5.240.0170.08020.18
5.4.450.0970.05719.39
5.4.440.0900.06319.45
5.4.430.0870.05319.70
5.4.420.0200.05019.30
5.4.410.0830.06019.21
5.4.400.0470.05719.15
5.4.390.0130.07718.98
5.4.380.0370.06018.57
5.4.370.0170.05318.48
5.4.360.0300.04318.58
5.4.350.0300.05018.76
5.4.340.0230.05318.48
5.4.320.0050.04212.52
5.4.310.0040.04312.51
5.4.300.0030.03912.52
5.4.290.0070.03612.51
5.4.280.0100.03912.38
5.4.270.0060.05212.38
5.4.260.0060.05112.38
5.4.250.0070.03912.38
5.4.240.0060.03812.38
5.4.230.0080.03812.37
5.4.220.0070.04612.37
5.4.210.0100.04712.37
5.4.200.0080.03912.37
5.4.190.0040.04412.37
5.4.180.0060.04012.37
5.4.170.0110.03712.38
5.4.160.0100.04912.38
5.4.150.0080.04512.37
5.4.140.0100.04812.05
5.4.130.0110.03712.05
5.4.120.0110.05012.00
5.4.110.0090.05411.99
5.4.100.0090.04711.99
5.4.90.0030.05312.00
5.4.80.0120.05612.00
5.4.70.0110.05311.99
5.4.60.0080.03611.99
5.4.50.0060.04112.00
5.4.40.0130.04911.98
5.4.30.0080.04211.98
5.4.20.0080.04511.98
5.4.10.0100.04211.98
5.4.00.0040.03911.47
5.3.290.0030.04212.80
5.3.280.0080.04212.71
5.3.270.0080.05712.72
5.3.260.0060.04312.72
5.3.250.0100.03612.72
5.3.240.0090.03612.72
5.3.230.0070.03812.71
5.3.220.0070.03912.68
5.3.210.0080.03912.68
5.3.200.0050.04012.68
5.3.190.0110.04312.68
5.3.180.0030.04212.67
5.3.170.0110.04912.67
5.3.160.0090.03912.68
5.3.150.0100.04912.67
5.3.140.0060.04312.66
5.3.130.0110.03812.66
5.3.120.0090.03712.66
5.3.110.0100.03512.66
5.3.100.0080.04112.12
5.3.90.0070.04312.08
5.3.80.0020.04212.07
5.3.70.0070.03712.08
5.3.60.0070.03712.06
5.3.50.0150.04412.00
5.3.40.0090.04712.00
5.3.30.0110.03311.97
5.3.20.0050.03811.75
5.3.10.0080.04811.71
5.3.00.0070.03611.70
5.2.170.0030.0349.20
5.2.160.0050.0319.20
5.2.150.0050.0369.20
5.2.140.0120.0579.19
5.2.130.0120.0469.15
5.2.120.0060.0339.15
5.2.110.0040.0319.16
5.2.100.0100.0549.16
5.2.90.0100.0379.16
5.2.80.0190.0729.16
5.2.70.0070.0329.15
5.2.60.0070.0329.10
5.2.50.0060.0319.07
5.2.40.0050.0339.05
5.2.30.0130.0459.03
5.2.20.0070.0409.02
5.2.10.0120.0388.93
5.2.00.0070.0328.80
5.1.60.0060.0378.08
5.1.50.0080.0358.08
5.1.40.0110.0408.06
5.1.30.0080.0408.41
5.1.20.0200.0448.43
5.1.10.0120.0488.16
5.1.00.0100.0468.16
5.0.50.0040.0346.63
5.0.40.0160.0406.50
5.0.30.0050.0456.31
5.0.20.0120.0246.28
5.0.10.0090.0476.25
5.0.00.0040.0426.24
4.4.90.0040.0264.77
4.4.80.0030.0254.76
4.4.70.0040.0254.75
4.4.60.0060.0234.76
4.4.50.0060.0234.77
4.4.40.0030.0394.71
4.4.30.0090.0254.76
4.4.20.0070.0354.85
4.4.10.0110.0364.85
4.4.00.0070.0704.76
4.3.110.0090.0434.67
4.3.100.0070.0394.66
4.3.90.0140.0334.63
4.3.80.0080.0494.58
4.3.70.0150.0294.63
4.3.60.0100.0354.63
4.3.50.0070.0194.63
4.3.40.0090.0354.54
4.3.30.0010.0223.27
4.3.20.0050.0343.25
4.3.10.0060.0333.22
4.3.00.0000.01310.37

preferences:
38.86 ms | 401 KiB | 5 Q