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($match[1].$match[2], $str); echo $letter . $word. $postion;

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.43
8.3.50.0040.01116.22
8.3.40.0140.00418.97
8.3.30.0090.00618.92
8.3.20.0080.00020.30
8.3.10.0050.00323.40
8.3.00.0040.00419.79
8.2.180.0120.00616.72
8.2.170.0110.00722.96
8.2.160.0120.00919.09
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00320.08
8.2.110.0100.00020.35
8.2.100.0120.00018.03
8.2.90.0080.00319.16
8.2.80.0000.00918.16
8.2.70.0080.00317.75
8.2.60.0030.00618.04
8.2.50.0080.00018.10
8.2.40.0070.00020.60
8.2.30.0040.00419.39
8.2.20.0000.00818.00
8.2.10.0000.00718.25
8.2.00.0050.00318.05
8.1.280.0120.00625.92
8.1.270.0030.00622.24
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00320.97
8.1.230.0080.00319.04
8.1.220.0040.00717.74
8.1.210.0070.00318.77
8.1.200.0030.00617.49
8.1.190.0090.00017.35
8.1.180.0040.00418.10
8.1.170.0040.00420.38
8.1.160.0040.00418.95
8.1.150.0050.00320.71
8.1.140.0000.00717.59
8.1.130.0080.00018.91
8.1.120.0040.00317.64
8.1.110.0050.00317.57
8.1.100.0040.00417.49
8.1.90.0030.00517.61
8.1.80.0080.00017.53
8.1.70.0040.00417.47
8.1.60.0060.00317.71
8.1.50.0040.00417.57
8.1.40.0040.00417.50
8.1.30.0040.00417.79
8.1.20.0000.00817.68
8.1.10.0030.00617.77
8.1.00.0060.00317.63
8.0.300.0000.00718.77
8.0.290.0040.00416.84
8.0.280.0070.00018.39
8.0.270.0040.00417.28
8.0.260.0000.00717.07
8.0.250.0070.00017.23
8.0.240.0030.00317.16
8.0.230.0000.00917.05
8.0.220.0040.00417.15
8.0.210.0000.00717.02
8.0.200.0040.00417.16
8.0.190.0040.00417.12
8.0.180.0000.00717.03
8.0.170.0000.00817.18
8.0.160.0040.00317.10
8.0.150.0030.00517.04
8.0.140.0050.00316.93
8.0.130.0000.00813.43
8.0.120.0000.00817.02
8.0.110.0040.00417.06
8.0.100.0040.00416.96
8.0.90.0040.00416.93
8.0.80.0060.01017.06
8.0.70.0000.00817.13
8.0.60.0000.00717.08
8.0.50.0000.00817.13
8.0.30.0110.00417.22
8.0.20.0090.01117.44
8.0.10.0040.00417.00
8.0.00.0030.01417.05
7.4.330.0000.00515.55
7.4.320.0070.00016.71
7.4.300.0030.00316.81
7.4.290.0060.00316.84
7.4.280.0050.00216.77
7.4.270.0080.00016.79
7.4.260.0050.00316.56
7.4.250.0050.00216.77
7.4.240.0000.00716.82
7.4.230.0050.00316.83
7.4.220.0070.01416.84
7.4.210.0130.00716.61
7.4.200.0080.00016.83
7.4.160.0130.00816.69
7.4.150.0060.01517.40
7.4.140.0060.01117.86
7.4.130.0000.01816.63
7.4.120.0120.00716.75
7.4.110.0100.00716.55
7.4.100.0070.01116.67
7.4.90.0040.01416.75
7.4.80.0110.01119.39
7.4.70.0100.00716.57
7.4.60.0120.00616.65
7.4.50.0100.00216.39
7.4.40.0100.00716.61
7.4.30.0060.01216.72
7.4.10.0060.01315.13
7.4.00.0110.00615.28
7.3.330.0000.00613.37
7.3.320.0000.00613.26
7.3.310.0000.00716.52
7.3.300.0020.00516.45
7.3.290.0080.00616.49
7.3.280.0080.00916.49
7.3.270.0170.00017.40
7.3.260.0090.00916.64
7.3.250.0110.00716.59
7.3.240.0080.01116.54
7.3.230.0000.02016.59
7.3.210.0100.00616.69
7.3.200.0100.01416.65
7.3.190.0120.00716.57
7.3.180.0100.00616.70
7.3.170.0080.00916.43
7.3.160.0130.00316.57
7.3.130.0150.00415.12
7.3.120.0100.01015.20
7.3.110.0070.01014.95
7.3.100.0160.00015.18
7.3.90.0070.01014.95
7.3.80.0070.00515.21
7.3.70.0030.01315.10
7.3.60.0030.00914.84
7.3.50.0000.01115.21
7.3.40.0140.00314.93
7.3.30.0060.00315.16
7.3.20.0060.00916.80
7.3.10.0050.00716.80
7.3.00.0040.00916.58
7.2.330.0140.00616.88
7.2.320.0070.01116.91
7.2.310.0080.00816.88
7.2.300.0040.01216.91
7.2.290.0110.00516.86
7.2.260.0040.01115.39
7.2.250.0090.00915.39
7.2.240.0030.01415.35
7.2.230.0110.00715.04
7.2.220.0080.00815.16
7.2.210.0030.00915.43
7.2.200.0070.01015.31
7.2.190.0080.00615.16
7.2.180.0000.01115.28
7.2.170.0060.00915.38
7.2.160.0060.00615.15
7.2.150.0000.01416.83
7.2.140.0040.00417.11
7.2.130.0040.01217.20
7.2.120.0080.00516.94
7.2.110.0040.00917.21
7.2.100.0040.00917.11
7.2.90.0060.00616.88
7.2.80.0080.00817.26
7.2.70.0030.01017.13
7.2.60.0080.00516.98
7.2.50.0080.00317.08
7.2.40.0090.00517.06
7.2.30.0050.00717.04
7.2.20.0050.00717.16
7.2.10.0040.01117.07
7.2.00.0030.01018.10
7.1.330.0100.00715.74
7.1.320.0100.00715.96
7.1.310.0070.00716.08
7.1.300.0070.00716.04
7.1.290.0130.00015.96
7.1.280.0070.00315.93
7.1.270.0040.00715.93
7.1.260.0100.00316.23
7.1.250.0060.00515.98
7.1.240.0000.01116.18
7.1.230.0050.00515.78
7.1.220.0030.01015.72
7.1.210.0090.00316.17
7.1.200.0070.00615.96
7.1.190.0000.01415.77
7.1.180.0090.00615.77
7.1.170.0060.00615.87
7.1.160.0130.00315.98
7.1.150.0030.00615.70
7.1.140.0040.00416.02
7.1.130.0040.01116.03
7.1.120.0070.00315.94
7.1.110.0000.01216.01
7.1.100.0070.00717.17
7.1.90.0030.00616.09
7.1.80.0070.01015.95
7.1.70.0120.01015.76
7.1.60.0250.01324.65
7.1.50.0290.01424.64
7.1.40.0210.01024.41
7.1.30.0210.01124.45
7.1.20.0210.01124.48
7.1.10.0190.01115.52
7.1.00.0180.00715.48
7.0.330.0030.01315.68
7.0.320.0150.00015.37
7.0.310.0000.01115.64
7.0.300.0080.00415.35
7.0.290.0060.00615.32
7.0.280.0060.00315.75
7.0.270.0000.01515.40
7.0.260.0030.00915.61
7.0.250.0030.01015.40
7.0.240.0110.00315.70
7.0.230.0090.00315.47
7.0.220.0070.00715.67
7.0.210.0130.00315.59
7.0.200.0140.00915.34
7.0.190.0170.01015.36
7.0.180.0150.00614.99
7.0.170.0110.01115.11
7.0.160.0160.00814.86
7.0.150.0150.00915.00
7.0.140.0130.00815.13
7.0.130.0190.00715.22
7.0.120.0170.01115.29
7.0.110.0180.01015.15
7.0.100.0100.01215.14
7.0.90.0130.00815.12
7.0.80.0300.00715.02
7.0.70.0130.01015.09
7.0.60.0200.00815.12
7.0.50.0140.01115.03
7.0.40.0150.01214.04
7.0.30.0160.00814.16
7.0.20.0110.01214.24
7.0.10.0180.00814.29
7.0.00.0170.00814.16
5.6.400.0000.00914.73
5.6.390.0090.00614.62
5.6.380.0030.00614.63
5.6.370.0000.01114.23
5.6.360.0060.00614.59
5.6.350.0040.01114.64
5.6.340.0100.00314.64
5.6.330.0100.00314.58
5.6.320.0030.00614.71
5.6.310.0060.00614.63
5.6.300.0070.00714.20
5.6.290.0090.00614.38
5.6.280.0070.01014.43
5.6.270.0000.01114.48
5.6.260.0140.00314.35
5.6.250.0040.00714.64
5.6.240.0040.01114.40
5.6.230.0030.01014.49
5.6.220.0060.00914.58
5.6.210.0090.00914.39
5.6.200.0060.01114.64
5.6.190.0030.01014.65
5.6.180.0040.01114.25
5.6.170.0130.00314.38
5.6.160.0000.01614.50
5.6.150.0040.01114.46
5.6.140.0130.00014.31
5.6.130.0060.00614.86
5.6.120.0040.00414.11
5.6.110.0070.00314.18
5.6.100.0030.00614.45
5.6.90.0100.00314.75
5.6.80.0070.01114.22
5.6.70.0070.01014.46
5.6.60.0090.00614.44
5.6.50.0070.00714.20
5.6.40.0030.01314.55
5.6.30.0070.01014.39
5.6.20.0030.01014.41
5.6.10.0080.00814.19
5.6.00.0090.00314.35

preferences:
44.8 ms | 400 KiB | 5 Q