3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "string with dot. And another. Again."; $n = 35; // in your case 100 $pos = strrpos(substr($str,0,$n), "."); If($pos === false) $pos = strlen($str); Echo substr($str,0, $pos+1);

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.0120.01017.60
8.4.130.0120.00917.64
8.4.120.0030.00520.45
8.4.110.0070.01222.45
8.4.100.0090.00717.82
8.4.90.0130.00818.54
8.4.80.0050.00317.80
8.4.70.0120.00717.93
8.4.60.0120.00918.86
8.4.50.0100.01119.61
8.4.40.0080.00317.39
8.4.30.0030.00517.39
8.4.20.0100.01019.65
8.4.10.0030.00617.73
8.3.270.0110.01116.51
8.3.260.0120.00516.73
8.3.250.0060.00318.69
8.3.240.0120.00616.73
8.3.230.0160.00316.48
8.3.220.0120.00617.00
8.3.210.0120.00616.50
8.3.200.0030.00516.41
8.3.190.0040.00516.93
8.3.180.0050.00318.16
8.3.170.0140.00419.00
8.3.160.0070.00318.31
8.3.150.0080.00020.60
8.3.140.0100.00718.27
8.3.130.0100.00018.29
8.3.120.0030.00620.81
8.3.110.0040.00420.94
8.3.100.0080.00024.06
8.3.90.0000.00826.77
8.3.80.0110.00018.18
8.3.70.0070.01416.36
8.3.60.0070.01116.38
8.3.50.0060.01117.93
8.3.40.0070.01118.79
8.3.30.0090.00618.58
8.3.20.0040.00419.02
8.3.10.0040.00419.15
8.3.00.0000.00823.49
8.2.290.0080.01020.48
8.2.280.0120.00718.32
8.2.270.0110.00717.21
8.2.260.0090.00620.52
8.2.250.0170.00318.09
8.2.240.0090.00018.70
8.2.230.0000.00822.58
8.2.220.0090.00037.54
8.2.210.0000.00826.77
8.2.200.0080.00816.63
8.2.190.0030.01716.63
8.2.180.0100.00718.41
8.2.170.0150.00322.96
8.2.160.0110.00422.30
8.2.150.0000.00824.18
8.2.140.0140.00024.66
8.2.130.0000.00819.89
8.2.120.0080.00026.35
8.2.110.0030.00620.47
8.2.100.0080.00317.91
8.2.90.0080.00017.89
8.2.80.0040.00418.80
8.2.70.0040.00418.04
8.2.60.0080.00018.04
8.2.50.0000.00818.10
8.2.40.0000.00719.31
8.2.30.0070.00019.49
8.2.20.0000.00717.96
8.2.10.0040.00417.97
8.2.00.0000.00719.51
8.1.330.0080.00723.87
8.1.320.0110.01015.97
8.1.310.0150.00416.51
8.1.300.0080.00517.81
8.1.290.0000.01230.84
8.1.280.0030.01725.92
8.1.270.0070.01023.69
8.1.260.0040.00426.35
8.1.250.0090.00028.09
8.1.240.0060.00322.44
8.1.230.0090.00320.90
8.1.220.0040.00417.78
8.1.210.0040.00418.77
8.1.200.0000.00817.53
8.1.190.0090.00017.10
8.1.180.0040.00418.10
8.1.170.0060.00318.34
8.1.160.0040.00418.74
8.1.150.0040.00418.78
8.1.140.0000.00717.60
8.1.130.0040.00418.96
8.1.120.0020.00517.41
8.1.110.0040.00417.32
8.1.100.0000.00717.40
8.1.90.0070.00017.38
8.1.80.0070.00317.29
8.1.70.0030.00617.38
8.1.60.0000.00917.49
8.1.50.0000.00717.44
8.1.40.0070.00417.45
8.1.30.0080.00417.61
8.1.20.0030.00517.61
8.1.10.0000.00717.52
8.1.00.0040.00417.47
8.0.300.0000.00720.14
8.0.290.0030.00616.63
8.0.280.0000.00718.45
8.0.270.0030.00317.21
8.0.260.0060.00017.26
8.0.250.0030.00316.95
8.0.240.0000.00716.96
8.0.230.0000.00716.76
8.0.220.0000.00716.70
8.0.210.0000.00716.71
8.0.200.0070.00016.90
8.0.190.0030.00316.90
8.0.180.0040.00416.84
8.0.170.0000.00816.86
8.0.160.0040.00416.75
8.0.150.0030.00416.72
8.0.140.0040.00416.70
8.0.130.0050.00013.29
8.0.120.0080.00016.79
8.0.110.0040.00416.75
8.0.100.0070.00016.86
8.0.90.0030.00416.73
8.0.80.0090.00716.83
8.0.70.0000.00716.86
8.0.60.0000.00716.69
8.0.50.0000.00716.82
8.0.30.0080.01217.00
8.0.20.0150.00317.40
8.0.10.0000.00716.94
8.0.00.0080.01016.75
7.4.330.0030.00315.55
7.4.320.0000.00616.53
7.4.300.0030.00316.36
7.4.290.0070.00016.58
7.4.280.0000.00716.48
7.4.270.0000.00716.57
7.4.260.0000.00716.34
7.4.250.0000.00816.46
7.4.240.0050.00216.61
7.4.230.0000.00716.63
7.4.220.0040.00416.38
7.4.210.0090.01016.56
7.4.200.0030.00316.32
7.4.160.0100.00716.49
7.4.140.0110.00617.86
7.4.130.0070.01116.36
7.4.120.0090.01016.57
7.4.110.0100.00716.35
7.4.100.0150.00716.35
7.4.90.0110.00616.40
7.4.80.0040.01719.39
7.4.70.0110.01116.54
7.4.60.0100.00716.53
7.4.50.0030.00916.36
7.4.40.0090.01216.30
7.4.00.0060.00915.05
7.3.330.0040.00413.06
7.3.320.0020.00213.11
7.3.310.0030.00316.40
7.3.300.0000.00616.25
7.3.290.0000.00716.29
7.3.280.0100.00416.27
7.3.260.0110.00616.42
7.3.240.0060.01116.35
7.3.230.0180.00616.15
7.3.210.0120.00416.43
7.3.200.0060.01216.19
7.3.190.0080.00816.37
7.3.180.0060.01216.38
7.3.170.0060.01116.31
7.3.160.0030.01216.40
7.2.330.0140.00416.41
7.2.320.0060.01216.47
7.2.310.0060.01616.45
7.2.300.0130.00816.63
7.2.290.0060.01616.38
7.2.80.0040.01116.54
7.2.60.1790.00814.68
7.2.50.1710.00514.84
7.2.40.2200.00615.34
7.2.30.2140.00815.04
7.2.20.2290.00915.23
7.2.10.2130.00815.57
7.2.00.2540.00715.53
7.1.200.0100.00315.66
7.1.170.1570.00913.73
7.1.160.2220.01016.77
7.1.150.2290.00916.82
7.1.140.1770.01016.85
7.1.130.2240.00917.00
7.1.120.2780.01116.75
7.1.110.2310.00816.00
7.1.100.2340.01316.15
7.1.90.1910.01016.39
7.1.80.2830.01016.09
7.1.70.2610.00715.25
7.1.60.3060.01433.21
7.1.50.3310.01333.07
7.1.40.4170.01332.66
7.1.30.3710.00932.58
7.1.20.3520.01532.72
7.1.10.2610.01014.82
7.1.00.2200.01014.78

preferences:
38.85 ms | 403 KiB | 5 Q