3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class MyType { const UNKNOWN = 0; const VALUE_ONE = 1; const VALUE_TWO = 2; const VALUE_THREE = 3; const VALUE_FOUR = 4; const VALUE_FIVE = 5; static public $__names = array( 0 => 'UNKNOWN', 1 => 'VALUE_ONE', 2 => 'VALUE_TWO', 3 => 'VALUE_THREE', 4 => 'VALUE_FOUR', 5 => 'VALUE_FIVE', ); } $test = new MyType(); echo MyType::$__names[count(MyType::$__names) - 1]; //echo constant('MyType::' . MyType::__names[count($test->__names) - 1]); ?>

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.0110.00718.18
8.3.50.0070.01221.27
8.3.40.0070.00718.53
8.3.30.0000.01420.04
8.3.20.0080.00020.20
8.3.10.0000.00722.14
8.3.00.0080.00022.39
8.2.180.0190.00316.50
8.2.170.0140.00322.96
8.2.160.0130.00622.10
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00417.63
8.2.110.0030.00722.30
8.2.100.0060.00617.84
8.2.90.0000.00819.30
8.2.80.0030.00619.39
8.2.70.0000.00817.75
8.2.60.0000.00918.05
8.2.50.0030.00618.07
8.2.40.0070.00018.16
8.2.30.0030.00618.14
8.2.20.0040.00417.64
8.2.10.0000.00817.68
8.2.00.0030.00517.79
8.1.280.0100.00725.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00623.91
8.1.230.0100.00019.04
8.1.220.0070.00017.74
8.1.210.0000.00818.77
8.1.200.0070.00317.35
8.1.190.0040.00417.55
8.1.180.0000.00818.10
8.1.170.0040.00418.49
8.1.160.0070.00018.92
8.1.150.0040.00418.63
8.1.140.0000.00817.48
8.1.130.0050.00317.82
8.1.120.0030.00317.42
8.1.110.0000.00717.35
8.1.100.0040.00417.46
8.1.90.0000.00717.48
8.1.80.0040.00417.38
8.1.70.0030.00317.47
8.1.60.0060.00317.57
8.1.50.0000.00817.48
8.1.40.0050.00317.54
8.1.30.0040.00417.60
8.1.20.0040.00417.61
8.1.10.0000.00717.50
8.1.00.0070.00317.34
8.0.300.0050.00218.77
8.0.290.0040.00417.18
8.0.280.0000.00718.47
8.0.270.0050.00217.24
8.0.260.0030.00316.71
8.0.250.0030.00316.93
8.0.240.0000.00816.81
8.0.230.0030.00316.88
8.0.220.0030.00316.79
8.0.210.0030.00316.70
8.0.200.0040.00416.89
8.0.190.0060.00316.89
8.0.180.0060.00316.89
8.0.170.0040.00416.81
8.0.160.0000.00716.81
8.0.150.0070.00016.74
8.0.140.0000.00716.81
8.0.130.0030.00313.33
8.0.120.0040.00416.77
8.0.110.0030.00416.88
8.0.100.0000.00717.00
8.0.90.0000.00716.73
8.0.80.0070.00716.81
8.0.70.0040.00416.90
8.0.60.0000.00716.85
8.0.50.0070.00016.73
8.0.30.0100.01217.00
8.0.20.0090.00917.40
8.0.10.0070.00317.02
8.0.00.0120.00916.78
7.4.330.0000.00515.00
7.4.320.0060.00016.59
7.4.300.0000.00616.48
7.4.290.0100.00016.49
7.4.280.0000.00716.46
7.4.270.0030.00316.60
7.4.260.0030.00613.27
7.4.250.0070.00016.54
7.4.240.0060.00116.52
7.4.230.0030.00316.29
7.4.220.0130.00616.53
7.4.210.0110.00716.45
7.4.200.0030.00516.37
7.4.190.0000.00816.68
7.4.160.0120.00316.61
7.4.150.0060.01517.40
7.4.140.0120.00717.86
7.4.130.0050.01116.52
7.4.120.0140.00516.56
7.4.110.0080.00816.63
7.4.100.0140.00916.45
7.4.90.0120.00616.43
7.4.80.0130.01019.39
7.4.70.0090.00916.43
7.4.60.0000.01516.42
7.4.50.0030.00616.31
7.4.40.0130.00322.77
7.4.30.0090.01316.52
7.4.00.0100.00314.88
7.3.330.0020.00213.08
7.3.320.0000.00513.20
7.3.310.0040.00416.34
7.3.300.0030.00316.23
7.3.290.0070.00716.31
7.3.280.0140.00416.25
7.3.270.0140.00917.40
7.3.260.0080.00816.41
7.3.250.0080.00916.46
7.3.240.0060.01016.32
7.3.230.0070.01616.49
7.3.210.0100.01016.41
7.3.200.0110.00619.39
7.3.190.0070.01616.21
7.3.180.0100.00716.48
7.3.170.0060.00916.43
7.3.160.0070.01016.58
7.3.120.0000.01315.05
7.2.330.0120.00616.49
7.2.320.0120.00916.77
7.2.310.0120.00616.88
7.2.300.0060.00916.43
7.2.290.0170.00316.59
7.2.110.0220.00316.47
7.2.60.0070.01016.62
7.2.00.0090.00619.30
7.1.200.0090.00615.80
7.1.100.0000.01218.19
7.1.70.0000.00716.95
7.1.60.0100.01619.32
7.1.50.0070.00416.84
7.1.00.0030.05722.54
7.0.200.0720.00314.73
7.0.140.0000.07722.15
7.0.100.0100.07319.81
7.0.90.0100.05319.82
7.0.80.0000.06719.87
7.0.70.0030.08319.93
7.0.60.0170.04019.95
7.0.50.0100.09020.19
7.0.40.0000.05019.98
7.0.30.0070.04720.00
7.0.20.0070.06720.11
7.0.10.0070.05720.09
7.0.00.0070.05720.00
5.6.280.0030.07320.91
5.6.250.0130.04020.55
5.6.240.0170.08320.61
5.6.230.0070.07020.59
5.6.220.0070.05020.59
5.6.210.0200.07720.42
5.6.200.0200.06721.07
5.6.190.0070.05020.90
5.6.180.0000.08021.01
5.6.170.0100.07720.98
5.6.160.0170.07021.09
5.6.150.0130.07720.89
5.6.140.0130.04321.09
5.6.130.0070.04721.12
5.6.120.0170.07320.89
5.6.110.0070.08321.02
5.6.100.0030.06721.00
5.6.90.0070.05021.05
5.6.80.0130.08020.51
5.6.70.0030.06720.50
5.6.60.0070.04020.39
5.6.50.0100.05720.36
5.6.40.0030.08320.34
5.6.30.0070.07320.48
5.6.20.0070.07020.35
5.6.10.0000.05720.48
5.6.00.0030.08320.23
5.5.380.0100.06720.34
5.5.370.0100.08020.34
5.5.360.0070.07020.30
5.5.350.0100.04320.41
5.5.340.0170.07320.69
5.5.330.0170.06320.59
5.5.320.0000.08720.76
5.5.310.0070.06020.73
5.5.300.0100.08020.88
5.5.290.0030.08320.84
5.5.280.0100.07720.59
5.5.270.0130.06320.77
5.5.260.0070.06320.83
5.5.250.0070.05320.56
5.5.240.0130.06320.09
5.5.230.0070.04720.21
5.5.220.0170.04720.05
5.5.210.0100.08020.12
5.5.200.0070.08020.18
5.5.190.0170.06020.18
5.5.180.0070.07720.22
5.5.160.0100.06020.05
5.5.150.0030.08319.97
5.5.140.0130.06320.08
5.5.130.0100.06720.09
5.5.120.0070.07720.11
5.5.110.0230.06720.07
5.5.100.0130.07020.04
5.5.90.0200.05719.97
5.5.80.0130.06719.93
5.5.70.0070.05020.07
5.5.60.0030.05720.06
5.5.50.0070.06019.98
5.5.40.0070.04720.02
5.5.30.0170.05719.93
5.5.20.0030.07720.04
5.5.10.0000.08719.99
5.5.00.0170.07020.05
5.4.450.0170.08019.46
5.4.440.0030.06019.54
5.4.430.0030.06719.46
5.4.420.0070.07719.37
5.4.410.0030.06019.32
5.4.400.0100.07319.04
5.4.390.0070.07319.04
5.4.380.0030.06719.12
5.4.370.0070.07318.92
5.4.360.0070.04319.09
5.4.350.0070.07719.14
5.4.340.0070.04719.21
5.4.320.0200.06318.88
5.4.310.0030.04719.05
5.4.300.0100.06719.18
5.4.290.0100.05318.85
5.4.280.0070.07318.95
5.4.270.0000.08719.20
5.4.260.0170.05719.21
5.4.250.0130.07019.21
5.4.240.0130.04018.84
5.4.230.0070.04019.16
5.4.220.0030.06718.89
5.4.210.0030.04019.20
5.4.200.0030.07019.04
5.4.190.0100.06019.13
5.4.180.0070.07319.03
5.4.170.0070.07318.94
5.4.160.0030.08019.11
5.4.150.0130.04319.13
5.4.140.0070.06716.21
5.4.130.0100.03316.40
5.4.120.0100.06716.20
5.4.110.0030.07316.34
5.4.100.0030.08016.47
5.4.90.0100.05716.51
5.4.80.0130.06316.42
5.4.70.0070.07016.46
5.4.60.0100.07316.52
5.4.50.0170.06716.42
5.4.40.0100.04016.36
5.4.30.0000.04716.46
5.4.20.0070.06316.39
5.4.10.0070.05016.29
5.4.00.0070.03315.73
5.3.290.0030.08014.71
5.3.280.0070.03314.71
5.3.270.0070.07014.62
5.3.260.0100.07314.55
5.3.250.0070.08014.73
5.3.240.0170.04714.62
5.3.230.0070.07314.71
5.3.220.0030.04714.70
5.3.210.0070.05014.63
5.3.200.0070.06314.70
5.3.190.0100.07714.54
5.3.180.0170.06714.54
5.3.170.0170.05314.68
5.3.160.0000.07314.66
5.3.150.0030.04014.70
5.3.140.0100.06314.48
5.3.130.0070.05014.52
5.3.120.0030.04014.59
5.3.110.0070.07314.48
5.3.100.0170.03714.16
5.3.90.0070.04314.02
5.3.80.0000.07714.14
5.3.70.0100.07014.03
5.3.60.0130.03313.91
5.3.50.0000.04713.95
5.3.40.0030.06714.00
5.3.30.0130.07013.91
5.3.20.0070.04013.82
5.3.10.0070.06313.78
5.3.00.0130.03313.57
5.2.170.0030.06711.21
5.2.160.0030.06311.21
5.2.150.0030.06311.05
5.2.140.0030.06011.12
5.2.130.0000.07311.19
5.2.120.0070.03311.03
5.2.110.0030.03311.01
5.2.100.0030.04711.00
5.2.90.0100.02711.09
5.2.80.0000.05711.15
5.2.70.0000.03711.14
5.2.60.0100.05011.03
5.2.50.0000.04711.04
5.2.40.0030.03311.10
5.2.30.0130.05311.10
5.2.20.0030.06010.94
5.2.10.0030.04310.81
5.2.00.0070.05710.85
5.1.60.0070.05710.07
5.1.50.0000.06010.05
5.1.40.0130.04010.06
5.1.30.0070.05710.34
5.1.20.0100.04310.47
5.1.10.0100.05010.17
5.1.00.0030.0579.91
5.0.50.0070.0408.55
5.0.40.0100.0378.39
5.0.30.0070.0338.27
5.0.20.0030.0438.20
5.0.10.0000.0478.16
5.0.00.0000.0678.22
4.4.90.0030.0338.09
4.4.80.0030.0338.09
4.4.70.0000.0238.09
4.4.60.0030.0338.09
4.4.50.0030.0308.09
4.4.40.0030.0538.09
4.4.30.0030.0378.09
4.4.20.0030.0338.09
4.4.10.0000.0378.09
4.4.00.0000.0538.09
4.3.110.0000.0308.09
4.3.100.0070.0278.09
4.3.90.0070.0308.09
4.3.80.0030.0538.09
4.3.70.0070.0278.09
4.3.60.0030.0338.09
4.3.50.0030.0338.09
4.3.40.0030.0508.09
4.3.30.0030.0338.09
4.3.20.0000.0338.09
4.3.10.0000.0238.09
4.3.00.0000.0308.09

preferences:
40.71 ms | 401 KiB | 5 Q