3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getConstantName($category, $constantNumber) { foreach (get_defined_constants() as $key => $value) { if (strlen($key) > strlen($category)) { if (substr($key, 0, strlen($category)) === $category) { if ($value === $constantNumber) { return $key; } return "No constant found."; } } } } echo getConstantName('IMAGE', 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.00716.88
8.3.50.0100.00921.98
8.3.40.0120.00918.77
8.3.30.0040.01119.17
8.3.20.0040.00420.64
8.3.10.0000.00821.73
8.3.00.0040.00419.31
8.2.180.0100.01316.38
8.2.170.0060.00922.96
8.2.160.0130.00622.16
8.2.150.0090.00024.18
8.2.140.0000.00824.66
8.2.130.0020.00526.16
8.2.120.0080.00019.77
8.2.110.0040.00422.13
8.2.100.0000.01119.51
8.2.90.0080.00019.32
8.2.80.0050.00317.97
8.2.70.0000.00917.63
8.2.60.0090.00017.93
8.2.50.0080.00018.07
8.2.40.0060.00318.31
8.2.30.0040.00419.58
8.2.20.0050.00317.82
8.2.10.0050.00318.06
8.2.00.0000.00817.84
8.1.280.0170.00325.92
8.1.270.0090.00018.95
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0060.00323.97
8.1.230.0000.01319.28
8.1.220.0060.00317.78
8.1.210.0040.00418.77
8.1.200.0040.00417.25
8.1.190.0040.00417.22
8.1.180.0030.00518.10
8.1.170.0030.00618.76
8.1.160.0000.00722.14
8.1.150.0040.00419.05
8.1.140.0050.00217.57
8.1.130.0030.00317.88
8.1.120.0040.00417.61
8.1.110.0060.00317.58
8.1.100.0000.00717.59
8.1.90.0040.00417.60
8.1.80.0070.00017.61
8.1.70.0040.00417.62
8.1.60.0000.00817.68
8.1.50.0040.00417.48
8.1.40.0000.00717.65
8.1.30.0000.00817.80
8.1.20.0080.00017.68
8.1.10.0000.00817.58
8.1.00.0040.00417.53
8.0.300.0040.00418.77
8.0.290.0070.00016.75
8.0.280.0070.00018.57
8.0.270.0000.00717.39
8.0.260.0000.00717.42
8.0.250.0030.00317.08
8.0.240.0040.00417.02
8.0.230.0060.00317.07
8.0.220.0030.00316.87
8.0.210.0030.00316.98
8.0.200.0030.00317.07
8.0.190.0030.00317.07
8.0.180.0040.00417.03
8.0.170.0000.00917.03
8.0.160.0000.00717.09
8.0.150.0070.00016.89
8.0.140.0040.00416.86
8.0.130.0030.00313.39
8.0.120.0050.00316.88
8.0.110.0040.00417.07
8.0.100.0050.00317.04
8.0.90.0030.00316.91
8.0.80.0070.01017.08
8.0.70.0040.00417.14
8.0.60.0080.00016.93
8.0.50.0000.00816.79
8.0.30.0130.01017.15
8.0.20.0070.01217.40
8.0.10.0000.00816.98
8.0.00.0130.00516.92
7.4.330.0000.00515.14
7.4.320.0030.00316.77
7.4.300.0000.00616.75
7.4.290.0000.00716.61
7.4.280.0040.00416.70
7.4.270.0030.00316.68
7.4.260.0000.00916.60
7.4.250.0050.00216.68
7.4.240.0030.00316.60
7.4.230.0040.00416.68
7.4.220.0160.00316.67
7.4.210.0080.01016.63
7.4.200.0040.00416.47
7.4.160.0100.00616.75
7.4.150.0160.00317.40
7.4.140.0130.00717.86
7.4.130.0090.00916.72
7.4.120.0100.00716.57
7.4.110.0060.01216.75
7.4.100.0080.00816.71
7.4.90.0130.00416.51
7.4.80.0100.01319.39
7.4.70.0130.00316.57
7.4.60.0030.01316.77
7.4.50.0020.00216.60
7.4.40.0070.01016.60
7.4.30.0100.00716.61
7.4.00.0070.01015.04
7.3.330.0050.00013.37
7.3.320.0000.00513.14
7.3.310.0070.00016.39
7.3.300.0000.00716.29
7.3.290.0040.00416.29
7.3.280.0050.01116.39
7.3.270.0130.01017.40
7.3.260.0150.00316.70
7.3.250.0070.01016.72
7.3.240.0120.00616.64
7.3.230.0140.00316.73
7.3.210.0060.01116.63
7.3.200.0100.01219.39
7.3.190.0070.01416.37
7.3.180.0100.00716.69
7.3.170.0090.01116.70
7.3.160.0100.00616.74
7.2.330.0070.01116.85
7.2.320.0100.00716.48
7.2.310.0150.00316.62
7.2.300.0100.00716.82
7.2.290.0040.01516.88
7.2.60.0100.00317.04
7.2.00.0040.01119.50
7.1.200.0090.00316.03
7.1.100.0100.00017.95
7.1.70.0040.00717.13
7.1.60.0070.01819.46
7.1.50.0030.01016.96
7.1.00.0030.07722.30
7.0.200.0040.00416.84
7.0.140.0130.05322.09
7.0.60.0070.04320.03
7.0.50.0070.07317.95
7.0.40.0000.06720.25
7.0.30.0400.06020.12
7.0.20.0200.08320.28
7.0.10.0030.04320.25
7.0.00.0000.04320.24
5.6.280.0100.07021.02
5.6.210.0200.07720.80
5.6.200.0130.08018.17
5.6.190.0100.08020.41
5.6.180.0300.04320.61
5.6.170.0200.08320.46
5.6.160.0030.05320.49
5.6.150.0100.05018.23
5.6.140.0070.04318.22
5.6.130.0000.04718.27
5.6.120.0070.06721.00
5.6.110.0030.06321.17
5.6.100.0070.08721.00
5.6.90.0070.08020.98
5.6.80.0030.04020.47
5.5.350.0170.04720.47
5.5.340.0070.06718.05
5.5.330.0070.06720.07
5.5.320.0100.04020.30
5.5.310.0370.06320.28
5.5.300.0070.04018.02
5.5.290.0100.08318.08
5.5.280.0000.06320.90
5.5.270.0170.04720.97
5.5.260.0130.06720.79
5.5.250.0070.04020.61
5.5.240.0030.05720.27
5.4.450.0500.05719.46
5.4.440.0270.04719.60
5.4.430.0170.05719.69
5.4.420.0230.05719.48
5.4.410.0230.07319.47
5.4.400.0670.06018.87
5.4.390.0930.06018.63
5.4.380.1100.04718.90
5.4.370.0970.06318.74
5.4.360.0930.06018.70
5.4.350.1130.04318.91
5.4.340.0730.05718.95
5.4.320.0730.06018.89
5.4.310.0730.05718.96
5.4.300.0770.05718.68
5.4.290.0900.05018.86
5.4.280.1100.05018.92
5.4.270.0970.06318.72
5.4.260.1100.05318.74
5.4.250.0930.06018.90
5.4.240.1000.05318.70
5.4.230.0900.06318.89
5.4.220.0870.06318.72
5.4.210.1070.05718.69
5.4.200.1130.06016.70
5.4.190.0870.06018.71
5.4.180.0930.06718.70
5.4.170.0900.06318.68
5.4.160.1030.05318.65
5.4.150.0970.06018.84
5.4.140.1400.05316.50
5.4.130.1100.05316.60
5.4.120.1100.05316.41
5.4.110.1000.05716.36
5.4.100.0830.06316.44
5.4.90.0900.04316.39
5.4.80.1130.04716.42
5.4.70.1270.06316.37
5.4.60.1030.05016.41
5.4.50.1100.05316.41
5.4.40.0900.04716.43
5.4.30.1070.06716.40
5.4.20.0970.05716.34
5.4.10.1170.04716.56
5.4.00.1070.05015.88
5.3.290.1030.05314.82
5.3.280.0970.06014.82
5.3.270.0930.06714.82
5.3.260.1000.05314.91
5.3.250.0970.05714.91
5.3.240.1030.05014.95
5.3.230.0970.05714.80
5.3.220.1100.06014.73
5.3.210.1000.05714.76
5.3.200.0870.06714.91
5.3.190.1130.04714.84
5.3.180.1070.05714.68
5.3.170.1100.04714.95
5.3.160.0870.04714.80
5.3.150.0900.06014.79
5.3.140.1300.06014.90
5.3.130.1130.05314.82
5.3.120.0900.06314.71
5.3.110.0970.05714.93
5.3.100.1030.05714.41
5.3.90.1000.04714.22
5.3.80.0970.05314.24
5.3.70.0930.05714.30
5.3.60.1130.05314.20
5.3.50.0930.05714.12
5.3.40.0970.05714.19
5.3.30.1170.06714.15
5.3.20.1070.04714.00
5.3.10.1000.04713.92
5.3.00.1000.05713.97
5.2.170.0830.05011.27
5.2.160.0870.04011.38
5.2.150.0930.04711.31
5.2.140.0630.04711.30
5.2.130.0700.04011.30
5.2.120.0770.04311.26
5.2.110.0830.06011.36
5.2.100.0930.05011.25
5.2.90.1030.05011.28
5.2.80.1000.05311.28
5.2.70.0870.04711.36
5.2.60.0870.04711.21
5.2.50.0770.04711.26
5.2.40.0670.04011.15
5.2.30.0700.04311.21
5.2.20.0630.04311.11
5.2.10.0700.04010.98
5.2.00.0670.04010.91
5.1.60.0730.03310.20
5.1.50.0670.03310.28
5.1.40.0630.03710.17
5.1.30.0600.03710.58
5.1.20.0730.03010.73
5.1.10.0730.03010.33
5.1.00.0600.05010.23
5.0.50.0430.0338.74
5.0.40.0370.0278.58
5.0.30.0330.0438.45
5.0.20.0330.0278.37
5.0.10.0430.0208.51
5.0.00.0270.0538.51
4.4.90.0230.0276.00
4.4.80.0370.0205.98
4.4.70.0400.0235.98
4.4.60.0470.0206.08
4.4.50.0370.0276.13
4.4.40.0370.0476.02
4.4.30.0300.0276.09
4.4.20.0300.0236.18
4.4.10.0370.0236.13
4.4.00.0330.0336.05
4.3.110.0370.0206.01
4.3.100.0330.0235.94
4.3.90.0330.0235.92
4.3.80.0330.0335.89
4.3.70.0300.0235.95
4.3.60.0330.0305.93
4.3.50.0330.0235.92
4.3.40.0400.0305.90
4.3.30.0170.0235.26
4.3.20.0170.0275.26
4.3.10.0170.0235.26
4.3.00.0130.0179.23

preferences:
67.08 ms | 401 KiB | 5 Q