3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "this is a Test String to get the last index of word with an uppercase letter in PHP"; $pattern = "/.*\s([A-Z])(\w+)/"; //$pattern = "/.*\s([A-Z])[A-Z]+/"; preg_match($pattern, $str, $match); var_dump($match); $letter = $match[1]; $word = $match[1] . $match[2]; $position = strrpos($str, $match[1].$match[2]); echo $letter . $word. $position;

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.70.0070.01116.63
8.3.60.0100.01018.24
8.3.50.0140.01216.62
8.3.40.0090.00619.02
8.3.30.0070.00719.01
8.3.20.0050.00320.34
8.3.10.0080.00023.65
8.3.00.0080.00019.56
8.2.190.0090.00617.00
8.2.180.0140.00016.88
8.2.170.0060.01222.96
8.2.160.0070.00719.17
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0000.00919.19
8.2.120.0080.00026.35
8.2.110.0090.00020.39
8.2.100.0060.00617.91
8.2.90.0070.00319.13
8.2.80.0030.00518.00
8.2.70.0060.00617.38
8.2.60.0030.00618.04
8.2.50.0050.00318.10
8.2.40.0040.00420.36
8.2.30.0040.00419.21
8.2.20.0000.00718.00
8.2.10.0040.00418.10
8.2.00.0040.00418.20
8.1.280.0110.00725.92
8.1.270.0040.00422.20
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00422.72
8.1.230.0040.00719.01
8.1.220.0090.00017.74
8.1.210.0060.00318.77
8.1.200.0030.00617.35
8.1.190.0060.00317.35
8.1.180.0000.00818.10
8.1.170.0040.00418.77
8.1.160.0000.00719.08
8.1.150.0000.00920.69
8.1.140.0000.01119.51
8.1.130.0070.00018.89
8.1.120.0040.00417.60
8.1.110.0000.00817.54
8.1.100.0080.00017.65
8.1.90.0050.00317.57
8.1.80.0000.00717.50
8.1.70.0030.00617.63
8.1.60.0000.00917.61
8.1.50.0000.00817.68
8.1.40.0040.00417.54
8.1.30.0050.00217.73
8.1.20.0000.00917.82
8.1.10.0060.00317.63
8.1.00.0000.00717.59
8.0.300.0040.00418.77
8.0.290.0060.00316.75
8.0.280.0070.00018.46
8.0.270.0030.00317.27
8.0.260.0030.00317.03
8.0.250.0030.00317.14
8.0.240.0030.00517.12
8.0.230.0000.00817.06
8.0.220.0030.00317.06
8.0.210.0030.00316.95
8.0.200.0000.00717.00
8.0.190.0090.00017.11
8.0.180.0000.00716.96
8.0.170.0000.00817.05
8.0.160.0040.00417.07
8.0.150.0030.00317.02
8.0.140.0000.00817.02
8.0.130.0030.00313.39
8.0.120.0040.00417.03
8.0.110.0070.00016.98
8.0.100.0000.00817.04
8.0.90.0050.00317.02
8.0.80.0120.00616.93
8.0.70.0000.00916.86
8.0.60.0070.00017.02
8.0.50.0000.00717.00
8.0.30.0080.00817.23
8.0.20.0160.00917.45
8.0.10.0040.00416.91
8.0.00.0060.01216.87
7.4.330.0060.00015.55
7.4.320.0000.00716.68
7.4.300.0000.00716.79
7.4.290.0030.00716.62
7.4.280.0040.00416.84
7.4.270.0040.00416.78
7.4.260.0000.00716.72
7.4.250.0080.00016.78
7.4.240.0030.00316.79
7.4.230.0030.00316.83
7.4.220.0100.00716.71
7.4.210.0150.00316.61
7.4.200.0080.00016.39
7.4.160.0050.01116.79
7.4.150.0110.00817.40
7.4.140.0130.00717.86
7.4.130.0090.00916.70
7.4.120.0090.01016.63
7.4.110.0130.00516.71
7.4.100.0120.00916.62
7.4.90.0080.01516.78
7.4.80.0150.00619.39
7.4.70.0090.00816.70
7.4.60.0070.01016.78
7.4.50.0100.00216.46
7.4.40.0060.01016.73
7.4.30.0080.00816.54
7.4.00.0060.00914.94
7.3.330.0030.00313.18
7.3.320.0000.00613.30
7.3.310.0030.00316.50
7.3.300.0040.00416.31
7.3.290.0090.00716.40
7.3.280.0090.00916.39
7.3.270.0120.00617.40
7.3.260.0130.00416.47
7.3.250.0090.00816.56
7.3.240.0140.00616.49
7.3.230.0030.02216.58
7.3.210.0030.01316.41
7.3.200.0190.00316.48
7.3.190.0080.00816.73
7.3.180.0110.00516.68
7.3.170.0130.00616.51
7.3.160.0040.01216.58
7.3.10.0210.00016.45
7.3.00.0170.00716.71
7.2.330.0110.00916.83
7.2.320.0050.01416.75
7.2.310.0100.00916.91
7.2.300.0060.01316.87
7.2.290.0150.00316.83
7.2.130.0180.00416.66
7.2.120.0260.00616.73
7.2.110.0140.00316.78
7.2.100.0050.01417.03
7.2.90.0150.00316.82
7.2.80.0100.00516.49
7.2.70.0160.01616.93
7.2.60.0200.00317.10
7.2.50.0300.00816.50
7.2.40.0130.00716.70
7.2.30.0290.01316.91
7.2.20.0380.00816.65
7.2.10.0310.00617.03
7.2.00.0150.01117.11
7.1.250.0160.00415.62
7.1.200.0080.00615.91
7.1.70.0160.01615.46
7.1.60.0560.02333.66
7.1.50.0430.01333.36
7.1.40.0340.02432.75
7.1.30.0420.01932.95
7.1.20.0410.01633.00
7.1.10.0170.01015.15
7.1.00.0780.01715.12
7.0.200.0180.00915.29
7.0.190.0240.01015.00
7.0.180.0220.01214.58
7.0.170.0250.00714.62
7.0.160.0180.00814.54
7.0.150.0160.00714.46
7.0.140.0170.01414.67
7.0.130.0330.01914.88
7.0.120.0200.01014.95
7.0.110.0250.01214.75
7.0.100.0290.01014.62
7.0.90.0190.01914.69
7.0.80.0310.00514.77
7.0.70.0190.01714.57
7.0.60.0180.01414.69
7.0.50.0260.01314.82
7.0.40.0490.01514.80
7.0.30.0260.01814.84
7.0.20.0190.01114.77
7.0.10.0200.00714.70
7.0.00.0180.01814.71

preferences:
28.03 ms | 401 KiB | 5 Q