3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = ['âa', 'Bbbbb', 'Éé', 'iou', 'Δδ']; $tests[] = 'ⅷ'; $tests[] = 'Ⅷ'; foreach ($tests as $test) { echo "\n{$test}:"; echo "\n\thasLetterVariants: " , preg_match('~^\p{L&}~u', $test) ? 'yes' : 'no'; echo "\n\tPREG (ext): " , preg_match('~^\p{Lu}~u', $test) ? 'upper' : 'not upper'; echo "\n\tPREG: " , preg_match('~^[\p{Lu}\x{2160}-\x{216F}]~u', $test) ? 'upper' : 'not upper'; echo "\n\tCTYPE: " , ctype_upper(mb_substr($test, 0, 1)) ? 'upper' : 'not upper'; echo "\n\t< a: " , mb_substr($test, 0, 1) < 'a' ? 'upper' : 'not upper'; $chr = mb_substr ($test, 0, 1, "UTF-8"); echo "\n\tMB: " , mb_strtoupper($chr, "UTF-8") == $chr ? 'upper' : 'not upper'; echo "\n\tIntlChar:" , IntlChar::isUUppercase(mb_substr($test, 0, 1)) ? 'upper' : 'not upper'; }

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.4.120.0110.00924.36
8.4.110.0130.00519.21
8.4.100.0070.00619.18
8.4.90.0070.00418.19
8.4.80.0110.01118.41
8.4.70.0130.00718.40
8.4.60.0110.01219.07
8.4.50.0140.00619.02
8.4.40.0040.00418.28
8.4.30.0090.00020.69
8.4.20.0070.00318.36
8.4.10.0030.00617.88
8.3.250.0110.00719.09
8.3.240.0100.00917.38
8.3.230.0060.00316.86
8.3.220.0050.00317.29
8.3.210.0100.01017.20
8.3.200.0070.00217.10
8.3.190.0090.01117.12
8.3.180.0120.00817.10
8.3.170.0040.00419.23
8.3.160.0140.00419.43
8.3.150.0070.01317.54
8.3.140.0000.00819.40
8.3.130.0090.00919.00
8.3.120.0030.00619.14
8.3.110.0160.00320.94
8.3.100.0000.00924.06
8.3.90.0000.00926.77
8.3.80.0030.00719.36
8.3.70.0140.00717.13
8.3.60.0090.00918.81
8.3.50.0170.00323.97
8.3.40.0100.01319.18
8.3.30.0040.01419.23
8.3.20.0040.00422.07
8.3.10.0050.00320.45
8.3.00.0030.00622.16
8.2.290.0060.00220.61
8.2.280.0120.01017.36
8.2.270.0000.01919.07
8.2.260.0040.00417.34
8.2.250.0100.01018.72
8.2.240.0100.00019.54
8.2.230.0030.00522.58
8.2.220.0060.00337.54
8.2.210.0040.00426.77
8.2.200.0060.00318.88
8.2.190.0000.01418.79
8.2.180.0110.00718.93
8.2.170.0210.00022.96
8.2.160.0040.01220.57
8.2.150.0030.00624.18
8.2.140.0030.00624.66
8.2.130.0080.00026.16
8.2.120.0030.00520.27
8.2.110.0090.00020.82
8.2.100.0220.00318.43
8.2.90.0050.00318.59
8.2.80.0000.00820.64
8.2.70.0080.00018.00
8.2.60.0030.00518.13
8.2.50.0030.00518.25
8.2.40.0060.00619.34
8.2.30.0060.00319.68
8.2.20.0090.00018.42
8.2.10.0040.00419.62
8.2.00.0000.00719.53
8.1.330.0100.00922.23
8.1.320.0120.00818.22
8.1.310.0040.01517.16
8.1.300.0000.00918.59
8.1.290.0030.00630.84
8.1.280.0160.00625.92
8.1.270.0000.00822.22
8.1.260.0080.00028.09
8.1.250.0030.00528.09
8.1.240.0030.00624.28
8.1.230.0080.00321.18
8.1.220.0030.00518.03
8.1.210.0000.00819.14
8.1.200.0060.00317.97
8.1.190.0050.00517.73
8.1.180.0000.00819.25
8.1.170.0040.00419.09
8.1.160.0030.00719.37
8.1.150.0030.00619.32
8.1.140.0040.00421.13
8.1.130.0080.00019.76
8.1.120.0070.00017.82
8.1.110.0030.00617.71
8.1.100.0050.00317.88
8.1.90.0050.00217.87
8.1.80.0070.00517.86
8.1.70.0040.00717.90
8.1.60.0050.00817.95
8.1.50.0100.00317.89
8.1.40.0090.00417.92
8.1.30.0080.00518.01
8.1.20.0070.00517.98
8.1.10.0050.00817.95
8.1.00.0120.00117.93
8.0.300.0040.00420.33
8.0.290.0060.00317.38
8.0.280.0000.00718.71
8.0.270.0030.00517.25
8.0.260.0000.00719.00
8.0.250.0030.00317.42
8.0.240.0030.00317.38
8.0.230.0050.00317.45
8.0.220.0090.00117.46
8.0.210.0040.00717.43
8.0.200.0110.00017.44
8.0.190.0040.00717.39
8.0.180.0050.00617.40
8.0.170.0060.00517.30
8.0.160.0070.00417.36
8.0.150.0050.00617.36
8.0.140.0080.00417.30
8.0.130.0110.00015.44
8.0.120.0060.00517.40
8.0.110.0040.00617.38
8.0.100.0060.00417.34
8.0.90.0070.00417.43
8.0.80.0080.00817.32
8.0.70.0080.00017.42
8.0.60.0070.00417.30
8.0.50.0060.00517.52
8.0.30.0120.00917.44
8.0.20.0120.00917.44
8.0.10.0160.00717.36
8.0.00.0120.00817.35
7.4.330.0050.00016.68
7.4.320.0030.00317.04
7.4.300.0070.00517.04
7.4.290.0060.00617.07
7.4.280.0060.00517.06
7.4.270.0030.00817.01
7.4.260.0050.00817.00
7.4.250.0080.00416.97
7.4.240.0050.00516.98
7.4.230.0090.00317.06
7.4.220.0060.00316.96
7.4.210.0070.00817.09
7.4.200.0050.00516.95
7.4.190.0140.00016.90
7.4.180.0110.00317.04
7.4.160.0180.00616.90
7.4.150.0110.00917.01
7.4.140.0130.00916.93
7.4.130.0130.00616.91
7.4.120.0100.00916.88
7.4.110.0100.00916.92
7.4.100.0120.00717.02
7.4.90.0090.00916.88
7.4.80.0130.00617.41
7.4.70.0120.00716.93
7.4.60.0130.00816.92
7.4.50.0120.00716.82
7.4.40.0160.00416.93
7.4.30.0120.00917.00
7.4.20.0150.00916.80
7.4.10.0100.00916.92
7.4.00.0110.00816.95
7.3.330.0020.00916.74
7.3.320.0050.00615.21
7.3.310.0060.00516.96
7.3.300.0050.00516.84
7.3.290.0100.00616.83
7.3.280.0140.00516.78
7.3.270.0150.00616.84
7.3.260.0130.00816.83
7.3.250.0110.00916.83
7.3.240.0120.00716.85
7.3.230.0120.00616.76
7.3.220.0110.00816.60
7.3.210.0100.01116.70
7.3.200.0160.00616.62
7.3.190.0140.01016.62
7.3.180.0110.01016.70
7.3.170.0110.01016.59
7.3.160.0100.01116.71
7.3.150.0070.01316.68
7.3.140.0110.00916.67
7.3.130.0120.00816.66
7.3.120.0110.00716.84
7.3.110.0140.00516.69
7.3.100.0110.00616.71
7.3.90.0120.00916.91
7.3.80.0110.00816.77
7.3.70.0130.00516.88
7.3.60.0090.00916.82
7.3.50.0120.00716.85
7.3.40.0090.01016.83
7.3.30.0150.00616.78
7.3.20.0130.00817.14
7.3.10.0090.01017.00
7.3.00.0130.00617.01
7.2.340.0160.00516.83
7.2.330.0130.00916.96
7.2.320.0130.00816.86
7.2.310.0180.00617.00
7.2.300.0140.01016.90
7.2.290.0170.00716.90
7.2.280.0180.00716.88
7.2.270.0140.01016.88
7.2.260.0120.00916.89
7.2.250.0130.00916.85
7.2.240.0120.00916.92
7.2.230.0120.00816.86
7.2.220.0110.00816.98
7.2.210.0110.00816.88
7.2.200.0150.00816.88
7.2.190.0120.00816.92
7.2.180.0120.00816.98
7.2.170.0110.00917.00
7.2.160.0150.00517.02
7.2.150.0120.00917.23
7.2.140.0110.00917.37
7.2.130.0170.00617.35
7.2.120.0180.00717.32
7.2.110.0130.01017.32
7.2.100.0110.01017.37
7.2.90.0150.00717.31
7.2.80.0140.00717.24
7.2.70.0130.01017.38
7.2.60.0140.00917.32
7.2.50.0150.00617.27
7.2.40.0130.00717.30
7.2.30.0130.00717.35
7.2.20.0170.01017.25
7.2.10.0130.00917.24
7.2.00.0110.00917.31

preferences:
28.9 ms | 403 KiB | 5 Q