3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Ozzie; use Exception; use ReflectionClass; class Language { const DUTCH = 1; private static $languages_values; public static function getConstName($value) { if (!isset(self::$languages_values[$value])) { throw new Exception('de value bestaat niet!'); } return self::$languages_values[$value]; } public static function init() { static $initialized = false; if ( ! $initialized) { $ref_class = new ReflectionClass(self::class); self::$languages_values = array_flip($ref_class->getConstants()); $initialized = true; } } } // ja, dit zet je in het zelfde bestand Language::init(); // nee, dit dan weer niet niet echo Language::getConstName(1), Language::getConstName(42);

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.00718.68
8.3.50.0110.00921.27
8.3.40.0070.00718.83
8.3.30.0140.00020.34
8.3.20.0050.00320.29
8.3.10.0000.01122.09
8.3.00.0000.00822.43
8.2.180.0090.00616.75
8.2.170.0110.00422.96
8.2.160.0090.00920.44
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0040.00419.66
8.2.110.0090.00022.20
8.2.100.0070.00419.21
8.2.90.0080.00019.17
8.2.80.0000.00819.28
8.2.70.0040.00417.75
8.2.60.0000.00717.93
8.2.50.0000.00818.07
8.2.40.0040.00418.21
8.2.30.0000.00718.01
8.2.20.0050.00317.68
8.2.10.0080.00017.69
8.2.00.0040.00417.69
8.1.280.0070.00725.92
8.1.270.0190.00020.40
8.1.260.0080.00026.35
8.1.250.0050.00228.09
8.1.240.0030.00623.92
8.1.230.0110.00019.21
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0000.00817.52
8.1.180.0080.00018.10
8.1.170.0040.00418.55
8.1.160.0040.00422.04
8.1.150.0040.00418.68
8.1.140.0050.00217.42
8.1.130.0080.00017.88
8.1.120.0000.00717.36
8.1.110.0080.00017.35
8.1.100.0040.00417.37
8.1.90.0040.00417.50
8.1.80.0030.00317.45
8.1.70.0030.00317.39
8.1.60.0030.00617.61
8.1.50.0040.00417.54
8.1.40.0040.00417.43
8.1.30.0000.00717.66
8.1.20.0000.00817.68
8.1.10.0000.00917.59
8.1.00.0000.00817.51
8.0.300.0000.00718.77
8.0.290.0040.00417.18
8.0.280.0030.00318.37
8.0.270.0030.00317.28
8.0.260.0000.00716.94
8.0.250.0000.00716.94
8.0.240.0040.00417.03
8.0.230.0030.00317.00
8.0.220.0070.00016.96
8.0.210.0070.00016.87
8.0.200.0000.00716.98
8.0.190.0040.00416.91
8.0.180.0040.00416.96
8.0.170.0040.00416.95
8.0.160.0000.00717.07
8.0.150.0040.00416.95
8.0.140.0000.01016.98
8.0.130.0000.00613.33
8.0.120.0040.00416.83
8.0.110.0040.00417.01
8.0.100.0070.00016.91
8.0.90.0000.00716.85
8.0.80.0030.01216.98
8.0.70.0000.00816.84
8.0.60.0000.00816.97
8.0.50.0050.00316.89
8.0.30.0080.01017.13
8.0.20.0080.01117.41
8.0.10.0000.00816.88
8.0.00.0140.01017.00
7.4.330.0000.00515.00
7.4.320.0030.00316.46
7.4.300.0000.00616.66
7.4.290.0030.00316.41
7.4.280.0030.00316.43
7.4.270.0070.00016.54
7.4.260.0030.00516.58
7.4.250.0040.00416.58
7.4.240.0030.00416.51
7.4.230.0080.00016.31
7.4.220.0100.00716.39
7.4.210.0070.01116.58
7.4.200.0000.00816.62
7.4.190.0040.00416.70
7.4.160.0080.00816.69
7.4.150.0150.00317.40
7.4.140.0100.00817.86
7.4.130.0100.01216.49
7.4.120.0100.00616.70
7.4.110.0160.00616.68
7.4.100.0070.01016.49
7.4.90.0060.01216.55
7.4.80.0070.01019.39
7.4.70.0090.01216.54
7.4.60.0160.00716.46
7.4.50.0080.00016.29
7.4.40.0100.00522.77
7.4.30.0130.00616.54
7.4.00.0060.00615.20
7.3.330.0050.00013.42
7.3.320.0000.00613.29
7.3.310.0000.00716.53
7.3.300.0000.00716.43
7.3.290.0130.00716.40
7.3.280.0110.00316.43
7.3.270.0170.00017.40
7.3.260.0120.01016.33
7.3.250.0080.00916.49
7.3.240.0140.00716.61
7.3.230.0090.00916.45
7.3.210.0170.00616.39
7.3.200.0030.01919.39
7.3.190.0140.01016.56
7.3.180.0100.00716.54
7.3.170.0060.00916.45
7.3.160.0090.01216.71
7.3.120.0040.00814.87
7.2.330.0130.00516.83
7.2.320.0130.00516.81
7.2.310.0070.01116.37
7.2.300.0100.00616.88
7.2.290.0070.01016.84
7.2.60.0080.00416.96
7.2.00.0060.00619.32
7.1.200.0040.00415.97
7.1.100.0040.00718.15
7.1.70.0060.00316.93
7.1.60.0160.00619.50
7.1.50.0080.00316.83
7.1.00.0070.03022.36
7.0.200.0030.00516.94
7.0.140.0100.06721.96
7.0.60.0070.07720.08
7.0.50.0070.07717.89
7.0.40.0100.07720.30
7.0.30.0200.04020.20
7.0.20.0300.06320.10
7.0.10.0200.05320.08
7.0.00.0130.08320.20
5.6.280.0070.07020.79
5.6.210.0070.05720.54
5.6.200.0030.04018.19
5.6.190.0070.08720.55
5.6.180.0230.05720.44
5.6.170.0300.07320.55
5.6.160.0070.08720.46
5.6.150.0030.08718.20
5.6.140.0030.05018.13
5.6.130.0130.07718.27
5.6.120.0100.08021.02
5.6.110.0000.08320.96
5.6.100.0100.08021.09
5.6.90.0070.04020.98
5.6.80.0200.06320.34
5.6.70.0370.07020.40
5.5.350.0270.08020.33
5.5.340.0000.04017.98
5.5.330.0170.06720.49
5.5.320.0170.06720.22
5.5.310.0230.08320.51
5.5.300.0200.06018.00
5.5.290.0070.05717.96
5.5.280.0070.04320.68
5.5.270.0030.06020.77
5.5.260.0100.08720.80
5.5.250.0130.06320.48
5.5.240.0170.06320.27
5.4.450.0200.05019.61
5.4.440.0900.06719.41
5.4.430.0730.05319.18
5.4.420.0730.05319.33
5.4.410.0130.05318.95
5.4.400.0500.05718.52
5.4.390.0370.05718.70
5.4.380.0300.05018.58
5.4.370.0270.06718.59
5.4.360.0170.07318.79
5.4.350.0050.03512.04
5.4.340.0050.03812.04
5.4.320.0050.03612.52
5.4.310.0060.04812.52
5.4.300.0060.04212.52
5.4.290.0080.03712.51
5.4.280.0070.03512.39
5.4.270.0040.04112.38
5.4.260.0040.04012.39
5.4.250.0060.04012.38
5.4.240.0030.03912.38
5.4.230.0060.03812.38
5.4.220.0060.03612.38
5.4.210.0050.03712.38
5.4.200.0050.03812.38
5.4.190.0050.03612.38
5.4.180.0070.03512.37
5.4.170.0040.03812.38
5.4.160.0060.03612.38
5.4.150.0060.03612.38
5.4.140.0050.03912.06
5.4.130.0100.03312.04
5.4.120.0080.03812.01
5.4.110.0080.03612.01
5.4.100.0030.03912.01
5.4.90.0040.03712.01
5.4.80.0060.03712.01
5.4.70.0110.02912.00
5.4.60.0090.03212.00
5.4.50.0060.03412.00
5.4.40.0110.02911.99
5.4.30.0070.03511.99
5.4.20.0050.03611.98
5.4.10.0070.03511.99
5.4.00.0030.03811.48
5.3.290.0130.04112.80
5.3.280.0050.04512.71
5.3.270.0080.04112.73
5.3.260.0090.03612.72
5.3.250.0030.04112.72
5.3.240.0070.04212.72
5.3.230.0050.04112.71
5.3.220.0110.05012.68
5.3.210.0090.05312.68
5.3.200.0090.03812.68
5.3.190.0050.04212.68
5.3.180.0070.04012.68
5.3.170.0090.03612.67
5.3.160.0090.03612.68
5.3.150.0070.03912.67
5.3.140.0070.04112.66
5.3.130.0040.04412.66
5.3.120.0080.04012.66
5.3.110.0080.03912.66
5.3.100.0100.03712.12
5.3.90.0110.03312.08
5.3.80.0050.03912.07
5.3.70.0080.03612.08
5.3.60.0050.03912.06
5.3.50.0070.03712.00
5.3.40.0070.03912.00
5.3.30.0080.03511.96
5.3.20.0060.03611.74
5.3.10.0070.03511.71
5.3.00.0060.03811.70
5.2.170.0090.0389.15
5.2.160.0100.0349.15
5.2.150.0050.0389.15
5.2.140.0060.0429.16
5.2.130.0060.0419.11
5.2.120.0040.0419.11
5.2.110.0070.0379.11
5.2.100.0050.0379.12
5.2.90.0070.0269.11
5.2.80.0060.0299.11
5.2.70.0050.0349.11
5.2.60.0080.0359.06
5.2.50.0080.0409.03
5.2.40.0050.0299.00
5.2.30.0070.0288.98
5.2.20.0050.0298.97
5.2.10.0040.0318.90
5.2.00.0040.0298.76
5.1.60.0070.0248.05
5.1.50.0070.0258.04
5.1.40.0060.0288.02
5.1.30.0040.0268.38
5.1.20.0060.0298.40
5.1.10.0070.0268.12
5.1.00.0060.0248.12
5.0.50.0050.0216.60
5.0.40.0050.0186.46
5.0.30.0070.0286.27
5.0.20.0020.0216.25
5.0.10.0050.0186.23
5.0.00.0060.0306.21
4.4.90.0040.0174.78
4.4.80.0030.0154.75
4.4.70.0020.0164.76
4.4.60.0030.0154.75
4.4.50.0030.0194.77
4.4.40.0030.0314.71
4.4.30.0040.0154.76
4.4.20.0040.0154.84
4.4.10.0040.0154.85
4.4.00.0050.0264.76
4.3.110.0010.0194.67
4.3.100.0030.0144.66
4.3.90.0030.0144.63
4.3.80.0030.0234.58
4.3.70.0020.0154.63
4.3.60.0000.0184.63
4.3.50.0030.0154.63
4.3.40.0020.0244.54
4.3.30.0010.0163.27
4.3.20.0010.0223.25
4.3.10.0020.0153.22
4.3.00.0130.0236.82

preferences:
46.24 ms | 400 KiB | 5 Q