3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lookup = ['neither', 'upper', 'lower']; $tests = ['A', 'z', '+', '0', 'ǻ', 'Ͱ', null]; foreach ($tests as $test) { if (preg_match('~(\p{Lu})|(\p{Ll})~u', $test, $out)) { end($out); // advance pointer to final element $index = key($out); } else { $index = 0; } echo "{$test}: {$lookup[$index]}\n"; }

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.140.0140.00817.87
8.4.130.0090.01018.02
8.4.120.0050.00420.73
8.4.110.0120.00918.84
8.4.100.0110.01118.42
8.4.90.0040.00518.45
8.4.80.0120.00918.40
8.4.70.0130.00318.38
8.4.60.0140.00718.93
8.4.50.0110.00620.88
8.4.40.0170.00318.11
8.4.30.0070.01020.29
8.4.20.0090.00020.57
8.4.10.0100.00719.93
8.3.270.0100.00916.88
8.3.260.0100.01016.85
8.3.250.0100.00819.03
8.3.240.0100.00916.81
8.3.230.0090.01116.79
8.3.220.0040.00416.96
8.3.210.0140.00518.83
8.3.200.0050.00416.93
8.3.190.0070.00117.13
8.3.180.0100.01116.87
8.3.170.0100.00617.37
8.3.160.0090.00918.69
8.3.150.0090.00617.11
8.3.140.0030.00618.91
8.3.130.0070.00718.61
8.3.120.0070.01320.47
8.3.110.0000.01818.71
8.3.100.0040.00816.97
8.3.90.0040.00426.77
8.3.80.0080.00418.93
8.3.70.0150.00616.88
8.3.60.0150.00018.55
8.3.50.0100.00618.44
8.3.40.0110.00418.96
8.3.30.0080.00818.88
8.3.20.0040.00421.07
8.3.10.0040.00420.39
8.3.00.0040.00421.63
8.2.290.0110.00920.18
8.2.280.0130.00618.54
8.2.270.0110.00717.44
8.2.260.0060.00317.31
8.2.250.0080.00016.96
8.2.240.0000.00817.40
8.2.230.0060.00320.94
8.2.220.0060.00324.06
8.2.210.0110.00426.77
8.2.200.0090.00018.66
8.2.190.0130.00317.00
8.2.180.0110.00425.92
8.2.170.0090.00922.96
8.2.160.0100.00320.31
8.2.150.0090.00024.18
8.2.140.0080.00624.66
8.2.130.0040.00426.16
8.2.120.0050.00319.79
8.2.110.0060.00321.12
8.2.100.0080.00418.11
8.2.90.0000.00919.34
8.2.80.0030.00617.97
8.2.70.0090.00017.93
8.2.60.0000.00818.28
8.2.50.0040.00418.10
8.2.40.0060.00319.50
8.2.30.0000.00719.43
8.2.20.0000.00718.32
8.2.10.0040.00419.32
8.2.00.0070.00019.46
8.1.330.0110.00816.61
8.1.320.0100.00916.63
8.1.310.0110.00718.56
8.1.300.0120.00318.57
8.1.290.0030.00630.84
8.1.280.0030.01025.92
8.1.270.0050.00322.33
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0090.00020.82
8.1.230.0000.01120.81
8.1.220.0050.00317.91
8.1.210.0080.00018.77
8.1.200.0000.01017.50
8.1.190.0060.00317.36
8.1.180.0060.00318.10
8.1.170.0050.00318.74
8.1.160.0000.00818.93
8.1.150.0080.00018.98
8.1.140.0000.00719.02
8.1.130.0040.00417.59
8.1.120.0040.00417.66
8.1.110.0000.00817.52
8.1.100.0040.00417.68
8.1.90.0070.00417.61
8.1.80.0040.00417.68
8.1.70.0040.00417.54
8.1.60.0050.00317.60
8.1.50.0030.00517.57
8.1.40.0040.00417.66
8.1.30.0000.00817.75
8.1.20.0080.00017.83
8.1.10.0000.00717.67
8.1.00.0060.00317.66
8.0.300.0040.00421.71
8.0.290.0050.00316.75
8.0.280.0030.00318.52
8.0.270.0000.00716.91
8.0.260.0000.00717.02
8.0.250.0000.00717.10
8.0.240.0050.00217.25
8.0.230.0030.00517.07
8.0.220.0030.00317.04
8.0.210.0040.00417.17
8.0.200.0030.00317.09
8.0.190.0000.00717.21
8.0.180.0070.00017.04
8.0.170.0030.00717.07
8.0.160.0040.00417.11
8.0.150.0040.00417.02
8.0.140.0080.00016.92
8.0.130.0090.00013.54
8.0.120.0090.00017.21
8.0.110.0030.00617.18
8.0.100.0040.00417.10
8.0.90.0040.00417.14
8.0.80.0100.00617.23
8.0.70.0040.00417.14
8.0.60.0040.00417.14
8.0.50.0040.00417.14
8.0.30.0130.00717.18
8.0.20.0100.01017.50
8.0.10.0080.00017.04
8.0.00.0120.00717.06
7.4.330.0000.00515.55
7.4.320.0000.00616.87
7.4.300.0060.00016.79
7.4.290.0040.00416.87
7.4.280.0000.00816.78
7.4.270.0030.00316.70
7.4.260.0040.00416.86
7.4.250.0050.00316.86
7.4.240.0040.00316.86
7.4.230.0070.00016.67
7.4.220.0040.00416.86
7.4.210.0100.00616.85
7.4.200.0040.00416.78
7.4.160.0110.00516.79
7.4.130.0100.00716.75
7.4.120.0030.01316.79
7.4.110.0060.01316.82
7.4.100.0070.01017.00
7.4.90.0110.01516.76
7.4.80.0090.00919.39
7.4.70.0060.01016.84
7.4.60.0080.00816.76
7.4.50.0070.00716.40
7.4.40.0040.01516.86
7.4.00.0040.01414.85
7.3.330.0050.00013.30
7.3.320.0070.00013.22
7.3.310.0030.00316.43
7.3.300.0000.00716.53
7.3.290.0040.00416.37
7.3.280.0080.01216.50
7.3.260.0100.00916.63
7.3.240.0090.01116.59
7.3.230.0110.00816.80
7.3.210.0070.01116.59
7.3.200.0140.00316.85
7.3.190.0060.00916.54
7.3.180.0070.01016.59
7.3.170.0120.00516.71
7.3.160.0030.01316.48
7.3.50.0070.00714.98
7.3.40.0130.00714.85
7.3.30.0080.00414.82
7.3.20.0090.00515.18
7.3.10.0230.00014.96
7.3.00.0100.00315.04
7.2.330.0120.00616.92
7.2.320.0040.01316.87
7.2.310.0030.01316.91
7.2.300.0160.00316.88
7.2.290.0140.00516.89
7.2.180.0060.00615.21
7.2.170.0030.00915.30
7.2.160.0030.00915.20
7.2.150.0070.00915.39
7.2.140.0240.00315.39
7.2.130.0170.01015.21
7.2.120.0070.00715.10
7.2.110.0090.00915.34
7.2.100.0100.00715.02
7.2.90.0230.01015.14
7.2.80.0220.00815.25
7.2.70.0120.00915.48
7.2.60.0160.00414.88
7.2.50.0170.01015.24
7.2.40.0080.00815.48
7.2.30.0130.00015.09
7.2.20.0040.01115.14
7.2.10.0100.01315.14
7.2.00.0160.00815.38
7.1.280.0090.01514.09
7.1.270.0070.00714.30
7.1.260.0130.00014.18
7.1.250.0800.01014.17

preferences:
140.65 ms | 403 KiB | 5 Q