3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = 'charanjeet/working/with/php'; echo strrpos($foo, '/', -5); echo (bool)strrpos($foo, '/', -5); //Answer: 18 => It will start searching it reverse direction after ignoring 5 five characters. //It will then return the position of the / after working, from the beginning charanjeet/working/ gạch / ở vị trí 18

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.0100.00616.50
8.3.60.0120.00318.56
8.3.50.0100.00317.99
8.3.40.0070.00718.57
8.3.30.0080.00818.57
8.3.20.0000.00921.92
8.3.10.0050.00223.67
8.3.00.0080.00019.43
8.2.190.0120.00916.58
8.2.180.0120.00618.37
8.2.170.0090.00622.96
8.2.160.0100.00322.08
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0070.01126.16
8.2.120.0070.00020.99
8.2.110.0060.00322.20
8.2.100.0090.00317.78
8.2.90.0030.00618.22
8.2.80.0050.00317.97
8.2.70.0080.00017.93
8.2.60.0050.00318.16
8.2.50.0000.00718.10
8.2.40.0040.00420.52
8.2.30.0040.00419.49
8.2.20.0040.00417.93
8.2.10.0000.01117.97
8.2.00.0000.00718.14
8.1.280.0120.00625.92
8.1.270.0040.00423.89
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00422.05
8.1.230.0000.01119.21
8.1.220.0000.00817.78
8.1.210.0000.00818.77
8.1.200.0040.00417.22
8.1.190.0000.00817.23
8.1.180.0050.00318.10
8.1.170.0000.00818.43
8.1.160.0050.00318.80
8.1.150.0000.00719.05
8.1.140.0000.00717.69
8.1.130.0030.00319.02
8.1.120.0000.00717.35
8.1.110.0040.00417.45
8.1.100.0000.00717.33
8.1.90.0040.00417.47
8.1.80.0040.00417.45
8.1.70.0000.00817.50
8.1.60.0090.00017.50
8.1.50.0000.00917.48
8.1.40.0000.00817.48
8.1.30.0030.00517.64
8.1.20.0000.00717.66
8.1.10.0080.00017.39
8.1.00.0060.00317.30
8.0.300.0070.00019.64
8.0.290.0070.00016.75
8.0.280.0070.00018.31
8.0.270.0030.00316.88
8.0.260.0060.00617.18
8.0.250.0080.00016.90
8.0.240.0080.00016.97
8.0.230.0000.00716.92
8.0.220.0000.00816.74
8.0.210.0030.00416.75
8.0.200.0060.00316.95
8.0.190.0070.00016.96
8.0.180.0070.00316.84
8.0.170.0000.00816.79
8.0.160.0000.00816.91
8.0.150.0000.00716.92
8.0.140.0050.00316.74
8.0.130.0030.00313.35
8.0.120.0040.00416.85
8.0.110.0040.00416.80
8.0.100.0040.00416.83
8.0.90.0050.00316.70
8.0.80.0190.00316.94
8.0.70.0040.00416.73
8.0.60.0000.00716.69
8.0.50.0070.00016.92
8.0.30.0130.00617.02
8.0.20.0080.01217.40
8.0.10.0000.00717.03
8.0.00.0070.01016.81
7.4.330.0000.00415.55
7.4.320.0040.00416.61
7.4.300.0040.00416.46
7.4.290.0050.00216.44
7.4.280.0070.00016.61
7.4.270.0000.00716.41
7.4.260.0030.00716.54
7.4.250.0040.00416.41
7.4.240.0070.00016.43
7.4.230.0030.00316.66
7.4.220.0000.00816.60
7.4.210.0050.01016.55
7.4.200.0000.00716.60
7.4.160.0090.00716.52
7.4.140.0110.00917.86
7.4.130.0120.00616.59
7.4.120.0110.00816.51
7.4.110.0070.01016.52
7.4.100.0130.00716.43
7.4.90.0070.01016.60
7.4.80.0170.00319.39
7.4.70.0100.00716.27
7.4.60.0100.00716.45
7.4.50.0140.00316.23
7.4.40.0030.01316.53
7.4.10.0060.01214.85
7.4.00.0130.00314.99
7.3.330.0000.00512.93
7.3.320.0050.00013.03
7.3.310.0000.00716.05
7.3.300.0070.00016.20
7.3.290.0030.00316.23
7.3.280.0070.00816.18
7.3.260.0140.00716.35
7.3.240.0100.00716.31
7.3.230.0060.01616.50
7.3.210.0030.01416.42
7.3.200.0060.00916.32
7.3.190.0080.00816.53
7.3.180.0090.00616.25
7.3.170.0080.00816.53
7.3.160.0090.00616.28
7.3.130.0000.01614.76
7.3.120.0140.00414.46
7.3.110.0130.00714.89
7.3.100.0030.01414.63
7.3.90.0040.01114.54
7.3.80.0070.00714.94
7.3.70.0060.00614.76
7.3.60.0060.00614.52
7.3.50.0070.00714.77
7.3.40.0030.00614.48
7.3.30.0100.00014.47
7.3.20.0040.01116.79
7.3.10.0080.00616.51
7.3.00.0010.00916.53
7.2.330.0100.00716.34
7.2.320.0070.01016.38
7.2.310.0100.00716.32
7.2.300.0070.01016.66
7.2.290.0100.00616.53
7.2.260.0050.01315.05
7.2.250.0070.01315.05
7.2.240.0080.00614.75
7.2.230.0060.01214.85
7.2.220.0030.01314.77
7.2.210.0070.00714.89
7.2.200.0060.00914.88
7.2.190.0090.00614.85
7.2.180.0030.00614.82
7.2.170.0030.01014.88
7.2.160.0040.00714.75
7.2.150.0070.00716.73
7.2.140.0110.00316.92
7.2.130.0030.00916.79
7.2.120.0070.00516.70
7.2.110.0070.00616.68
7.2.100.0050.00816.61
7.2.90.0100.00716.63
7.2.80.0070.00916.79
7.2.70.0070.00716.67
7.2.60.0080.00916.66
7.2.50.0070.00516.66
7.2.40.1360.00716.85
7.2.30.1140.01016.81
7.2.20.1150.00916.85
7.2.10.1020.00816.96
7.2.00.1060.00916.89
7.1.330.0070.00715.81
7.1.320.0090.00215.86
7.1.310.0040.00715.85
7.1.300.0060.00315.83
7.1.290.0090.00315.55
7.1.280.0120.00015.57
7.1.270.0000.01415.77
7.1.260.0090.00615.88
7.1.250.0070.00815.70
7.1.240.0060.00615.64
7.1.230.0090.00615.50
7.1.220.0070.00715.81
7.1.210.0060.00615.87
7.1.200.0120.00215.71
7.1.190.0030.01415.67
7.1.180.0000.01615.67
7.1.170.0060.00615.61
7.1.160.2580.00915.89
7.1.150.2180.00715.84
7.1.140.2160.00715.88
7.1.130.1890.00716.06
7.1.120.2030.00916.14
7.1.110.2110.01015.86
7.1.100.1640.00916.06
7.1.90.1030.00815.92
7.1.80.3100.01115.68
7.1.70.2460.00515.48
7.1.60.2200.00724.34
7.1.50.3870.00924.28
7.1.40.3280.01123.97
7.1.30.5020.00824.24
7.1.20.5200.01024.17
7.1.10.3700.01315.28
7.1.00.1930.01015.12
7.0.330.0070.00715.45
7.0.320.0060.00615.02
7.0.310.0070.00715.41
7.0.300.0040.00815.11
7.0.290.0040.00815.29
7.0.280.0000.01315.44
7.0.270.0030.00915.58
7.0.260.0080.00015.38
7.0.250.0060.00815.51
7.0.240.0000.00915.42
7.0.230.0000.01215.32
7.0.220.0040.00715.33
7.0.210.0030.00715.37
7.0.200.0000.01015.35
7.0.190.0030.01315.42
7.0.180.0000.01115.36
7.0.170.0080.00815.37
7.0.160.0000.00815.44
7.0.150.0080.00015.42
7.0.140.0060.00915.36
7.0.130.0080.00815.29
7.0.120.0030.00615.31
7.0.110.0040.01115.06
7.0.100.0070.00715.28
7.0.90.0030.01015.48
7.0.80.0060.00615.43
7.0.70.0070.00715.16
7.0.60.0070.00415.40
7.0.50.0070.00715.25
7.0.40.0030.00513.21
7.0.30.0090.00313.45
7.0.20.0100.00313.38
7.0.10.0060.00613.34
7.0.00.0050.00513.41
5.6.400.0000.01214.24
5.6.390.0000.01014.30
5.6.380.0090.00914.33
5.6.370.0060.00914.36
5.6.360.0070.00714.42
5.6.350.0000.01514.46
5.6.340.0030.00614.00
5.6.330.0030.01214.49
5.6.320.0000.01414.37
5.6.310.0040.00414.07
5.6.300.0030.01014.57
5.6.290.0050.00514.31
5.6.280.0030.00614.56
5.6.270.0070.00714.60
5.6.260.0040.01114.19
5.6.250.0040.00414.40
5.6.240.0070.00714.52
5.6.230.0090.00314.34
5.6.220.0040.00714.14
5.6.210.0000.01214.19
5.6.200.0110.00014.22
5.6.190.0060.00614.27
5.6.180.0000.01214.35
5.6.170.0030.00914.46
5.6.160.0000.01414.09
5.6.150.0100.00714.00
5.6.140.0040.00414.48
5.6.130.0080.00814.58
5.6.120.0070.00714.09
5.6.110.0060.00613.98
5.6.100.0000.01513.95
5.6.90.0070.01114.47
5.6.80.0110.00714.32
5.6.70.0090.00014.08
5.6.60.0090.00614.11
5.6.50.0110.00314.37
5.6.40.0040.01214.12
5.6.30.0080.00314.23
5.6.20.0030.00914.21
5.6.10.0080.00414.15
5.6.00.0060.00614.10

preferences:
50.41 ms | 401 KiB | 5 Q