3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = "test.string.1.sometext.more"; $startingOffset = 5; $pattern = '~^.{' . $startingOffset . '}[^.]*\K\.~'; $replacement = 2; echo preg_replace($pattern, $replacement, $str); echo "\n---\n"; $offset = strpos($str, '.', $startingOffset); if ($offset !== false) { $str[$offset] = $replacement; } echo $str;

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.5.30.0130.00417.66
8.5.20.0070.01021.14
8.5.10.0110.00719.63
8.5.00.0100.01120.31
8.4.180.0130.00919.87
8.4.170.0140.00821.88
8.4.160.0130.00923.92
8.4.150.0090.00716.94
8.4.140.0130.00817.73
8.4.130.0100.00918.66
8.4.120.0080.01224.19
8.4.110.0130.00718.85
8.4.100.0120.00917.77
8.4.90.0120.00917.82
8.4.80.0030.00622.67
8.4.70.0100.00917.97
8.4.60.0100.00818.78
8.4.50.0160.00520.36
8.4.40.0160.00319.82
8.4.30.0110.01020.48
8.4.20.0130.00719.98
8.4.10.0030.00617.77
8.3.300.0170.01118.55
8.3.290.0090.01120.93
8.3.280.0140.00818.32
8.3.270.0130.00616.69
8.3.260.0100.00616.57
8.3.250.0060.01018.94
8.3.240.0110.00817.13
8.3.230.0020.00716.69
8.3.220.0070.00917.19
8.3.210.0100.00716.82
8.3.200.0040.00516.85
8.3.190.0140.00517.04
8.3.180.0100.00918.40
8.3.170.0090.00916.89
8.3.160.0170.00318.45
8.3.150.0100.01316.87
8.3.140.0030.00517.05
8.3.130.0040.00416.82
8.3.120.0080.00020.72
8.3.110.0080.00020.94
8.3.100.0080.00016.65
8.3.90.0040.01126.77
8.3.80.0060.00317.97
8.3.70.0180.00416.75
8.3.60.0070.00718.31
8.3.50.0100.00324.48
8.3.40.0090.00618.93
8.3.30.0100.00618.94
8.3.20.0070.00020.73
8.3.10.0040.00420.16
8.3.00.0050.00320.69
8.2.300.0130.00918.35
8.2.290.0080.01122.12
8.2.280.0120.00622.19
8.2.270.0070.01417.07
8.2.260.0180.00020.51
8.2.250.0050.00316.67
8.2.240.0130.00717.20
8.2.230.0060.00322.58
8.2.220.0060.00324.06
8.2.210.0040.00426.77
8.2.200.0090.00018.66
8.2.190.0140.00016.58
8.2.180.0070.00718.54
8.2.170.0040.01122.96
8.2.160.0070.00722.96
8.2.150.0040.00424.18
8.2.140.0110.00424.66
8.2.130.0070.00026.16
8.2.120.0070.00021.05
8.2.110.0100.00022.39
8.2.100.0100.00717.84
8.2.90.0000.00917.75
8.2.80.0040.00419.04
8.2.70.0000.00817.75
8.2.60.0000.00817.88
8.2.50.0080.00017.61
8.2.40.0080.00017.75
8.2.30.0040.00618.76
8.2.20.0000.00718.06
8.2.10.0030.00618.40
8.2.00.0080.00418.63
8.1.340.0120.01217.76
8.1.330.0100.00916.62
8.1.320.0110.00916.59
8.1.310.0030.01618.30
8.1.300.0040.00416.52
8.1.290.0000.01118.88
8.1.280.0090.00625.92
8.1.270.0000.00820.64
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0040.00719.32
8.1.230.0080.00319.05
8.1.220.0080.00017.74
8.1.210.0090.00018.77
8.1.200.0000.00817.60
8.1.190.0000.00817.48
8.1.180.0030.00618.10
8.1.170.0040.00417.62
8.1.160.0050.00319.00
8.1.150.0080.00018.91
8.1.140.0060.00519.11
8.1.130.0080.00418.88
8.1.120.0090.00417.58
8.1.110.0100.00317.61
8.1.100.0100.00217.57
8.1.90.0050.00717.60
8.1.80.0060.00617.60
8.1.70.0090.00417.59
8.1.60.0130.00017.75
8.1.50.0140.00017.59
8.1.40.0080.00717.69
8.1.30.0060.00817.69
8.1.20.0040.01017.84
8.1.10.0090.00617.65
8.1.00.0080.00517.56
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0030.00318.40
8.0.270.0000.00817.00
8.0.260.0000.00918.50
8.0.250.0090.00317.09
8.0.240.0090.00317.07
8.0.230.0090.00517.01
8.0.220.0100.00216.94
8.0.210.0100.00316.93
8.0.200.0080.00317.06
8.0.190.0060.00617.04
8.0.180.0100.00417.04
8.0.170.0040.00917.07
8.0.160.0070.00417.02
8.0.150.0080.00216.90
8.0.140.0070.00216.98
8.0.130.0030.00615.19
8.0.120.0020.00916.90
8.0.110.0060.00416.96
8.0.100.0050.00416.99
8.0.90.0080.00416.99
8.0.80.0120.00316.89
8.0.70.0070.00516.94
8.0.60.0070.00417.04
8.0.50.0050.00717.00
8.0.30.0100.00517.16
8.0.20.0090.00916.96
8.0.10.0060.00617.11
8.0.00.0110.00717.03
7.4.330.0010.00515.92
7.4.320.0120.00216.76
7.4.300.0080.00416.78
7.4.290.0020.01016.78
7.4.280.0090.00416.68
7.4.270.0110.00316.75
7.4.260.0060.00515.03
7.4.250.0130.00016.77
7.4.240.0030.00816.64
7.4.230.0080.00316.78
7.4.220.0030.00716.68
7.4.210.0080.00816.78
7.4.200.0040.00716.78
7.4.190.0040.00916.72
7.4.180.0100.00516.64
7.4.160.0140.00016.78
7.4.150.0120.00316.63
7.4.140.0080.01117.30
7.4.130.0080.01116.77
7.4.120.0080.00916.67
7.4.110.0130.00416.59
7.4.100.0110.00416.61
7.4.90.0060.01016.59
7.4.80.0130.00318.01
7.4.70.0130.00216.65
7.4.60.0100.00516.65
7.4.50.0090.00816.51
7.4.40.0130.00216.62
7.4.30.0090.00416.73
7.4.20.0050.00916.64
7.4.10.0130.00016.49
7.4.00.0100.00715.58
7.3.330.0080.00416.44
7.3.320.0070.00214.79
7.3.310.0070.00316.49
7.3.300.0050.00716.45
7.3.290.0060.00916.48
7.3.280.0090.00716.38
7.3.270.0150.00016.49
7.3.260.0110.00516.33
7.3.250.0120.00616.41
7.3.240.0140.00216.30
7.3.230.0070.00916.67
7.3.220.0140.00216.39
7.3.210.0100.00616.47
7.3.200.0110.00516.50
7.3.190.0130.00516.41
7.3.180.0100.00516.56
7.3.170.0080.00816.51
7.3.160.0130.00316.50
7.3.150.0050.01116.40
7.3.140.0110.00416.50
7.3.130.0100.00516.30
7.3.120.0070.00615.50
7.3.110.0100.00715.49
7.3.100.0040.01215.42
7.3.90.0090.00815.45
7.3.80.0080.00715.48
7.3.70.0090.00515.56
7.3.60.0060.00915.30
7.3.50.0060.00915.39
7.3.40.0070.00815.55
7.3.30.0100.00515.48
7.3.20.0140.00616.08
7.3.10.0080.00716.10
7.3.00.0110.00416.08
7.2.340.0110.00416.55
7.2.330.0100.00716.70
7.2.320.0100.00616.80
7.2.310.0110.00816.72
7.2.300.0120.00716.73
7.2.290.0130.00416.79
7.2.280.0080.00816.55
7.2.270.0090.00916.69
7.2.260.0140.00316.66
7.2.250.0080.00916.05
7.2.240.0070.00715.73
7.2.230.0100.00515.66
7.2.220.0090.00815.70
7.2.210.0070.00915.59
7.2.200.0110.00515.74
7.2.190.0070.01015.62
7.2.180.0100.00815.74
7.2.170.0060.00815.70
7.2.160.0100.00616.01
7.2.150.0150.01215.92
7.2.140.0070.01016.06
7.2.130.0100.00916.06
7.2.120.0100.00715.99
7.2.110.0100.00715.95
7.2.100.0130.00716.00
7.2.90.0080.01215.98
7.2.80.0110.00615.96
7.2.70.0070.01116.03
7.2.60.0120.00716.00
7.2.50.0080.00815.97
7.2.40.0080.00916.03
7.2.30.0090.00716.05
7.2.20.0080.00916.16
7.2.10.0160.00915.99
7.2.00.0090.00616.03
7.1.330.0080.00615.41
7.1.320.0090.00615.42
7.1.310.0080.00815.57
7.1.300.0070.00815.52
7.1.290.0070.00715.49
7.1.280.0070.00715.40
7.1.270.0080.00515.46
7.1.260.0050.00915.45
7.1.250.0060.00915.20
7.1.240.0160.00016.30
7.1.230.0120.00416.30
7.1.220.0160.00016.30
7.1.210.0150.00016.30
7.1.200.0070.00716.30
7.1.190.0110.00416.30
7.1.180.0110.00616.30
7.1.170.0140.00316.30
7.1.160.0100.00516.30
7.1.150.0160.00016.30
7.1.140.0080.00816.30
7.1.130.0120.00616.30
7.1.120.0110.00516.30
7.1.110.0090.00416.30
7.1.100.0300.00017.39
7.1.90.0110.00417.35
7.1.80.0090.00617.63
7.1.70.0170.00317.27
7.1.60.0210.00017.52
7.1.50.0150.00417.39
7.1.40.0080.00817.47
7.1.30.0150.00417.43
7.1.20.0110.00717.31
7.1.10.0130.00417.31
7.1.00.0080.00817.39
7.0.330.0130.00316.95
7.0.320.0100.00617.20
7.0.310.0160.00016.93
7.0.300.0120.00517.05
7.0.290.0140.00317.14
7.0.280.0050.01017.24
7.0.270.0080.00816.94
7.0.260.0110.00517.14
7.0.250.0100.00717.06
7.0.240.0090.00617.05
7.0.230.0050.01117.27
7.0.220.0130.00317.18
7.0.210.0170.00016.99
7.0.200.0160.00017.20
7.0.190.0150.00016.95
7.0.180.0100.00717.04
7.0.170.0120.00317.11
7.0.160.0170.00017.09
7.0.150.0180.00016.90
7.0.140.0180.00017.14
7.0.130.0130.00717.21
7.0.120.0110.00416.99
7.0.110.0100.00617.09
7.0.100.0130.00317.09
7.0.90.0120.00616.89
7.0.80.0090.00516.87
7.0.70.0040.01316.95
7.0.60.0150.00217.09
7.0.50.0100.00716.79
7.0.40.0160.00016.90
7.0.30.0110.00716.90
7.0.20.0160.00016.93
7.0.10.0070.00717.02
7.0.00.0100.00716.82
5.6.400.0030.01216.30
5.6.390.0110.00316.30
5.6.380.0150.00216.30
5.6.370.0050.01216.30
5.6.360.0090.00516.30
5.6.350.0080.00416.30
5.6.340.0070.00716.30
5.6.330.0070.00716.30
5.6.320.0070.00716.30
5.6.310.0110.00316.30
5.6.300.0070.00716.30
5.6.290.0090.00316.30
5.6.280.0080.00416.30
5.6.270.0130.00016.30
5.6.260.0100.00216.30
5.6.250.0140.00016.30
5.6.240.0030.01016.30
5.6.230.0150.00016.30
5.6.220.0000.01416.30
5.6.210.0140.00016.30
5.6.200.0030.01016.30
5.6.190.0150.00016.30
5.6.180.0150.00016.30
5.6.170.0110.00316.30
5.6.160.0090.00616.30
5.6.150.0100.00516.30
5.6.140.0080.00516.30
5.6.130.0100.00316.30
5.6.120.0070.00716.30
5.6.110.0100.00716.30
5.6.100.0130.00216.30
5.6.90.0130.00016.30
5.6.80.0090.00416.30
5.6.70.0140.00016.30
5.6.60.0060.00616.30
5.6.50.0050.00816.30
5.6.40.0120.00216.30
5.6.30.0060.00616.30
5.6.20.0100.00216.30
5.6.10.0060.00616.30
5.6.00.0080.00416.30
5.5.380.0090.00416.30
5.5.370.0070.00716.30
5.5.360.0100.00316.30
5.5.350.0110.00216.30
5.5.340.0100.00316.30
5.5.330.0140.00016.30
5.5.320.0090.00516.30
5.5.310.0140.00016.30
5.5.300.0100.00316.30
5.5.290.0130.00016.30
5.5.280.0140.00016.30
5.5.270.0060.00616.30
5.5.260.0100.00316.30
5.5.250.0140.00016.30
5.5.240.0090.00516.30
5.5.230.0090.00316.30
5.5.220.0060.00616.30
5.5.210.0080.00416.30
5.5.200.0160.00016.30
5.5.190.0130.00016.30
5.5.180.0110.00316.30
5.5.170.0100.00516.30
5.5.160.0100.00316.30
5.5.150.0080.00416.30
5.5.140.0090.00416.30
5.5.130.0060.00816.30
5.5.120.0090.00416.30
5.5.110.0130.00016.30
5.5.100.0120.00016.30
5.5.90.0080.00416.30
5.5.80.0130.00016.30
5.5.70.0070.00716.30
5.5.60.0120.00016.30
5.5.50.0090.00416.30
5.5.40.0090.00616.30
5.5.30.0100.00316.30
5.5.20.0090.00516.30
5.5.10.0080.00516.30
5.5.00.0060.00616.30
5.4.450.0050.00516.30
5.4.440.0070.00316.30
5.4.430.0090.00216.30
5.4.420.0070.00316.30
5.4.410.0100.00016.30
5.4.400.0120.00016.30
5.4.390.0080.00316.30
5.4.380.0080.00416.30
5.4.370.0110.00016.30
5.4.360.0050.00516.30
5.4.350.0060.00616.30
5.4.340.0100.00216.30
5.4.330.0090.00316.30
5.4.320.0120.00016.30
5.4.310.0050.00516.30
5.4.300.0060.00616.30
5.4.290.0080.00416.30
5.4.280.0080.00416.30
5.4.270.0070.00416.30
5.4.260.0110.00016.30
5.4.250.0060.00616.30
5.4.240.0080.00316.30
5.4.230.0060.00616.30
5.4.220.0070.00416.30
5.4.210.0080.00416.30
5.4.200.0050.00516.30
5.4.190.0120.00016.30
5.4.180.0070.00516.30
5.4.170.0050.00516.30
5.4.160.0110.00016.30
5.4.150.0030.00716.30
5.4.140.0100.00016.30
5.4.130.0070.00416.30
5.4.120.0080.00316.30
5.4.110.0070.00316.30
5.4.100.0100.00016.30
5.4.90.0080.00316.30
5.4.80.0060.00316.30
5.4.70.0080.00316.30
5.4.60.0060.00616.30
5.4.50.0080.00316.30
5.4.40.0040.00716.30
5.4.30.0100.00016.30
5.4.20.0100.00016.30
5.4.10.0050.00516.30
5.4.00.0070.00316.30
5.3.290.0100.00216.30
5.3.280.0080.00316.30
5.3.270.0050.00516.30
5.3.260.0100.00016.30
5.3.250.0050.00516.30
5.3.240.0050.00516.30
5.3.230.0090.00216.30
5.3.220.0080.00316.30
5.3.210.0090.00216.30
5.3.200.0100.00216.30
5.3.190.0070.00416.30
5.3.180.0040.00816.30
5.3.170.0090.00316.30
5.3.160.0070.00316.30
5.3.150.0070.00316.30
5.3.140.0080.00316.30
5.3.130.0040.00716.30
5.3.120.0070.00416.30
5.3.110.0080.00416.30
5.3.100.0030.00916.30
5.3.90.0100.00016.30
5.3.80.0110.00216.30
5.3.70.0050.00516.30
5.3.60.0120.00016.30
5.3.50.0070.00516.30
5.3.40.0050.00516.30
5.3.30.0100.00016.30
5.3.20.0070.00216.30
5.3.10.0070.00216.30
5.3.00.0100.00216.30
5.2.170.0090.00016.30
5.2.160.0030.00616.30
5.2.150.0080.00016.30
5.2.140.0080.00016.30
5.2.130.0080.00016.30
5.2.120.0050.00316.30
5.2.110.0090.00016.30
5.2.100.0030.00616.30
5.2.90.0050.00516.30
5.2.80.0040.00416.30
5.2.70.0050.00516.30
5.2.60.0080.00216.30
5.2.50.0070.00216.30
5.2.40.0040.00416.30
5.2.30.0000.00916.30
5.2.20.0080.00016.30
5.2.10.0040.00416.30
5.2.00.0100.00016.30
5.1.60.0030.00616.30
5.1.50.0030.00616.30
5.1.40.0090.00016.30
5.1.30.0080.00016.30
5.1.20.0030.00616.30
5.1.10.0040.00416.30
5.1.00.0030.00616.30
5.0.50.0080.00016.30
5.0.40.0060.00016.30
5.0.30.0070.00016.30
5.0.20.0060.00016.30
5.0.10.0030.00316.30
5.0.00.0060.00016.30
4.4.90.0040.00016.30
4.4.80.0000.00416.30
4.4.70.0030.00016.30
4.4.60.0000.00416.30
4.4.50.0040.00016.30
4.4.40.0000.00416.30
4.4.30.0000.00316.30
4.4.20.0040.00016.30
4.4.10.0020.00216.30
4.4.00.0030.00016.30
4.3.110.0000.00316.30
4.3.100.0040.00016.30
4.3.90.0000.00416.30
4.3.80.0040.00016.30
4.3.70.0030.00016.30
4.3.60.0000.00416.30
4.3.50.0040.00016.30
4.3.40.0000.00416.30
4.3.30.0030.00016.30
4.3.20.0000.00316.30
4.3.10.0030.00016.30
4.3.00.0000.00316.30

preferences:
53.48 ms | 2696 KiB | 5 Q