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); $letter = $match[1]; $word = $match[1] . $match[2]; $position = strrpos($str, $match[1].$match[2]); echo "Letter to find: " . $letter . "\nWord to find: " . $word . "\nPosition of letter: " . $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.60.0140.00718.43
8.3.50.0060.00916.79
8.3.40.0150.00418.97
8.3.30.0110.00418.67
8.3.20.0080.00020.20
8.3.10.0040.00423.64
8.3.00.0050.00319.56
8.2.180.0140.00018.55
8.2.170.0110.00722.96
8.2.160.0110.00419.34
8.2.150.0000.00825.66
8.2.140.0000.00824.66
8.2.130.0070.00019.30
8.2.120.0080.00026.35
8.2.110.0060.00321.17
8.2.100.0060.00618.05
8.2.90.0040.00419.21
8.2.80.0080.00017.97
8.2.70.0060.00318.00
8.2.60.0040.00417.93
8.2.50.0000.00818.10
8.2.40.0050.00320.42
8.2.30.0040.00419.25
8.2.20.0000.00718.11
8.2.10.0040.00418.05
8.2.00.0040.00418.02
8.1.280.0070.01025.92
8.1.270.0040.00422.19
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0090.00023.98
8.1.230.0080.00417.45
8.1.220.0040.00417.79
8.1.210.0030.00518.77
8.1.200.0060.00317.38
8.1.190.0050.00317.38
8.1.180.0040.00418.10
8.1.170.0030.00518.60
8.1.160.0040.00418.94
8.1.150.0090.00020.70
8.1.140.0000.01119.66
8.1.130.0070.00017.63
8.1.120.0050.00217.51
8.1.110.0050.00317.46
8.1.100.0090.00017.61
8.1.90.0030.00617.61
8.1.80.0000.00817.54
8.1.70.0070.00017.61
8.1.60.0050.00517.71
8.1.50.0000.00817.57
8.1.40.0000.00917.70
8.1.30.0000.00717.77
8.1.20.0000.00817.70
8.1.10.0030.00617.61
8.1.00.0000.00717.64
8.0.300.0000.00818.77
8.0.290.0040.00416.88
8.0.280.0030.00318.46
8.0.270.0030.00317.30
8.0.260.0030.00316.87
8.0.250.0000.00717.02
8.0.240.0000.00817.01
8.0.230.0000.00816.97
8.0.220.0030.00317.04
8.0.210.0030.00517.00
8.0.200.0070.00017.04
8.0.190.0040.00417.10
8.0.180.0000.00717.05
8.0.170.0030.00516.94
8.0.160.0040.00417.07
8.0.150.0040.00416.98
8.0.140.0000.00717.00
8.0.130.0030.00613.39
8.0.120.0030.00617.04
8.0.110.0040.00417.04
8.0.100.0000.00716.98
8.0.90.0080.00016.98
8.0.80.0030.01617.10
8.0.70.0070.00317.10
8.0.60.0070.00016.93
8.0.50.0050.00317.05
8.0.30.0080.00917.15
8.0.20.0080.01017.40
8.0.10.0070.00016.96
8.0.00.0030.01617.05
7.4.330.0000.00515.55
7.4.320.0030.00316.59
7.4.300.0000.00616.73
7.4.290.0030.00616.80
7.4.280.0000.00716.82
7.4.270.0030.00316.57
7.4.260.0040.00416.70
7.4.250.0030.00316.58
7.4.240.0000.00716.72
7.4.230.0070.00016.75
7.4.220.0070.01416.64
7.4.210.0070.01416.65
7.4.200.0040.00416.66
7.4.160.0110.00716.74
7.4.150.0120.00617.40
7.4.140.0090.01317.86
7.4.130.0040.01416.61
7.4.120.0120.00716.68
7.4.110.0140.00416.56
7.4.100.0140.01116.75
7.4.90.0100.00716.66
7.4.80.0120.00619.39
7.4.70.0070.01016.71
7.4.60.0170.00316.56
7.4.50.0120.00616.68
7.4.40.0030.01316.67
7.4.30.0090.00916.64
7.4.00.0100.00715.29
7.3.330.0000.00713.23
7.3.320.0000.00513.33
7.3.310.0050.00216.45
7.3.300.0000.00716.46
7.3.290.0080.00716.45
7.3.280.0100.00716.42
7.3.270.0120.00617.40
7.3.260.0100.00716.63
7.3.250.0120.00616.52
7.3.240.0090.01116.58
7.3.230.0070.01016.53
7.3.210.0070.01016.75
7.3.200.0070.01016.54
7.3.190.0120.00816.59
7.3.180.0140.00316.71
7.3.170.0090.00916.52
7.3.160.0090.00616.61
7.2.330.0030.01516.88
7.2.320.0080.00816.88
7.2.310.0060.01016.99
7.2.300.0070.01316.77
7.2.290.0080.00816.65
7.2.60.0830.00715.07
7.2.00.0040.01119.67
7.1.200.0040.00415.88
7.1.100.0040.00718.37
7.1.70.0240.01215.43
7.1.60.0350.01433.48
7.1.50.0340.02133.18
7.1.40.0320.01232.61
7.1.30.0420.01332.94
7.1.20.0360.01632.95
7.1.10.0250.01115.04
7.1.00.0300.01615.16
7.0.200.0140.01515.06
7.0.190.0240.01114.99
7.0.180.0260.00614.52
7.0.170.0330.00314.42
7.0.160.0250.01114.61
7.0.150.0330.00014.79
7.0.140.0270.01514.84
7.0.130.0260.00914.95
7.0.120.0250.01214.84
7.0.110.0150.01514.47
7.0.100.0420.00514.65
7.0.90.0340.00614.78
7.0.80.0170.01014.89
7.0.70.0230.00714.70
7.0.60.0110.01514.55
7.0.50.0170.01314.70
7.0.40.0140.01315.02
7.0.30.0170.01314.84
7.0.20.0160.01614.85
7.0.10.0220.00914.84
7.0.00.0230.01214.77

preferences:
41.1 ms | 401 KiB | 5 Q