3v4l.org

run code in 300+ PHP versions simultaneously
<?php function replaceStrAt($str, $substr, $from, $to = null){ is_null($to) and $to = $from; return mb_substr($str, 0, $from) . $substr . mb_substr($str, $to + 1); } function insertSubstrInto($str, $substr, $index){ return mb_substr($str, 0, $index) . $substr . mb_substr($str, $index); } $s = 'И просто текст'; echo replaceStrAt($s, "\t", 4), "\n"; echo insertSubstrInto($s, "\t", 4), "\n";

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.0040.01218.16
8.3.50.0090.00916.34
8.3.40.0170.00018.64
8.3.30.0190.00318.71
8.3.20.0060.00318.65
8.3.10.0050.00320.92
8.3.00.0040.00423.61
8.2.180.0110.00425.92
8.2.170.0040.01119.13
8.2.160.0070.00722.96
8.2.150.0080.00025.66
8.2.140.0100.01024.66
8.2.130.0040.00426.16
8.2.120.0050.00320.84
8.2.110.0060.00322.07
8.2.100.0060.00617.91
8.2.90.0030.00618.03
8.2.80.0040.00417.97
8.2.70.0050.00317.50
8.2.60.0030.00717.91
8.2.50.0080.00018.07
8.2.40.0080.00618.78
8.2.30.0070.00517.89
8.2.20.0070.00417.88
8.2.10.0080.00417.81
8.2.00.0080.00418.50
8.1.280.0030.01225.92
8.1.270.0140.00324.66
8.1.260.0030.00526.35
8.1.250.0000.00728.09
8.1.240.0060.00323.96
8.1.230.0110.00020.97
8.1.220.0030.00517.79
8.1.210.0000.00818.77
8.1.200.0030.00617.36
8.1.190.0040.00417.22
8.1.180.0060.00318.10
8.1.170.0080.00418.06
8.1.160.0070.00518.19
8.1.150.0100.00218.29
8.1.140.0080.00317.62
8.1.130.0060.00617.56
8.1.120.0060.00817.55
8.1.110.0090.00417.48
8.1.100.0040.00817.47
8.1.90.0110.00217.56
8.1.80.0070.00717.49
8.1.70.0080.00317.54
8.1.60.0070.00717.61
8.1.50.0040.00917.57
8.1.40.0060.00617.61
8.1.30.0090.00417.66
8.1.20.0090.00417.61
8.1.10.0110.00217.58
8.1.00.0090.00417.56
8.0.300.0040.00420.03
8.0.290.0040.00416.75
8.0.280.0070.00518.04
8.0.270.0100.00217.26
8.0.260.0100.00217.24
8.0.250.0050.00617.30
8.0.240.0090.00217.28
8.0.230.0060.00617.27
8.0.220.0050.00717.28
8.0.210.0060.00617.25
8.0.200.0070.00517.34
8.0.190.0110.00117.33
8.0.180.0100.00417.26
8.0.170.0120.00017.33
8.0.160.0090.00317.29
8.0.150.0090.00317.28
8.0.140.0090.00217.29
8.0.130.0110.00115.50
8.0.120.0090.00317.21
8.0.110.0120.00117.21
8.0.100.0110.00217.23
8.0.90.0100.00217.24
8.0.80.0110.00517.26
8.0.70.0060.00617.21
8.0.60.0070.00517.28
8.0.50.0070.00517.32
8.0.30.0130.00817.16
8.0.20.0130.01117.24
8.0.10.0170.00617.12
8.0.00.0100.01017.05
7.4.330.0080.00116.58
7.4.320.0080.00317.04
7.4.300.0070.00317.13
7.4.290.0030.00817.07
7.4.280.0050.00617.07
7.4.270.0070.00517.06
7.4.260.0090.00217.11
7.4.250.0090.00317.10
7.4.240.0080.00317.02
7.4.230.0090.00217.16
7.4.220.0080.00317.09
7.4.210.0060.01016.86
7.4.200.0090.00217.12
7.4.190.0110.00317.62
7.4.180.0080.00617.62
7.4.160.0160.00416.80
7.4.150.0140.00916.81
7.4.140.0130.00617.44
7.4.130.0120.00816.72
7.4.120.0110.01116.62
7.4.110.0140.00916.68
7.4.100.0140.01016.67
7.4.90.0130.01016.64
7.4.80.0140.00717.15
7.4.70.0120.00816.68
7.4.60.0130.00916.64
7.4.50.0130.01016.62
7.4.40.0120.00916.67
7.4.30.0200.00516.77
7.4.20.0130.01116.76
7.4.10.0140.00916.73
7.4.00.0100.01016.27
7.3.330.0060.00315.53
7.3.320.0110.00015.39
7.3.310.0070.00317.01
7.3.300.0000.01116.99
7.3.290.0060.00616.96
7.3.280.0160.00516.64
7.3.270.0150.00616.76
7.3.260.0090.01016.64
7.3.250.0140.00816.70
7.3.240.0090.01116.61
7.3.230.0180.00516.62
7.3.220.0170.00616.68
7.3.210.0150.00716.66
7.3.200.0180.00716.63
7.3.190.0120.00916.65
7.3.180.0150.00716.58
7.3.170.0140.00816.62
7.3.160.0160.00716.58
7.3.150.0160.00816.59
7.3.140.0150.00716.57
7.3.130.0130.00916.58
7.3.120.0130.00816.35
7.3.110.0100.01116.28
7.3.100.0090.01116.37
7.3.90.0120.01116.48
7.3.80.0110.00916.34
7.3.70.0140.00516.32
7.3.60.0140.00616.35
7.3.50.0120.00616.17
7.3.40.0140.00716.15
7.3.30.0100.00916.16
7.3.20.0120.00816.61
7.3.10.0140.00616.60
7.3.00.0120.01016.63
7.2.340.0200.00616.80
7.2.330.0170.00716.71
7.2.320.0170.01216.75
7.2.310.0140.01116.68
7.2.300.0140.01016.69
7.2.290.0160.00916.63
7.2.280.0200.00616.71
7.2.270.0200.00816.70
7.2.260.0170.00816.70
7.2.250.0140.00916.48
7.2.240.0150.00916.46
7.2.230.0140.00916.39
7.2.220.0180.00516.41
7.2.210.0130.00816.45
7.2.200.0160.00716.54
7.2.190.0150.00516.39
7.2.180.0140.00716.23
7.2.170.0130.00816.23
7.2.160.0140.00916.47
7.2.150.0460.00416.76
7.2.140.0230.00616.71
7.2.130.0130.01016.78
7.2.120.0150.00716.78
7.2.110.0170.00816.79
7.2.100.0170.00616.79
7.2.90.0150.00816.79
7.2.80.0150.00916.74
7.2.70.0140.00916.75
7.2.60.0450.00916.49
7.2.50.0570.00616.47
7.2.40.0480.00916.63
7.2.30.0460.00816.57
7.2.20.0510.00816.61
7.2.10.0450.01016.55
7.2.00.0510.01016.53
7.1.330.0150.00916.14
7.1.320.0120.01016.13
7.1.310.0190.00516.17
7.1.300.0120.01016.07
7.1.290.0150.00716.13
7.1.280.0160.00615.82
7.1.270.0130.00815.82
7.1.260.0130.00915.81
7.1.250.0160.00715.89
7.1.240.0180.00715.86
7.1.230.0170.01015.81
7.1.220.0200.00515.85
7.1.210.0190.00715.82
7.1.200.0130.00815.81
7.1.190.0170.00715.89
7.1.180.0190.00715.84
7.1.170.0590.00715.59
7.1.160.0450.00915.94
7.1.150.0450.01116.00
7.1.140.0450.01216.02
7.1.130.0650.00815.93
7.1.120.0430.00815.97
7.1.110.0520.00915.95
7.1.100.0460.00715.86
7.1.90.0490.00715.88
7.1.80.0510.00915.92
7.1.70.0550.00715.80
7.1.60.0520.00818.07
7.1.50.0590.00718.04
7.1.40.0590.00817.84
7.1.30.0600.00817.95
7.1.20.0630.00617.98
7.1.10.0690.00715.72
7.1.00.0570.00615.77
7.0.330.0190.00715.37
7.0.320.0230.00515.72
7.0.310.0170.00715.71
7.0.300.0190.00915.70
7.0.290.0150.01115.72
7.0.280.0200.00715.73
7.0.270.0260.00715.62
7.0.260.0290.00415.66
7.0.250.0210.00615.71
7.0.240.0220.00415.77
7.0.230.0200.00715.73
7.0.220.0180.00815.72
7.0.210.0170.00815.71
7.0.200.0190.00915.72
7.0.190.0160.01015.77
7.0.180.0180.00815.69
7.0.170.0200.00615.82
7.0.160.0200.00715.73
7.0.150.0170.01115.71
7.0.140.0190.00715.75
7.0.130.0160.00815.67
7.0.120.0190.01115.78
7.0.110.0170.01015.70
7.0.100.0190.00715.75
7.0.90.0190.00815.72
7.0.80.0180.00915.67
7.0.70.0210.00615.62
7.0.60.0180.00615.70
7.0.50.0210.00715.67
7.0.40.0170.00715.72
7.0.30.0160.01215.67
7.0.20.0160.00815.73
7.0.10.0170.00915.77
7.0.00.0160.00915.69
5.6.400.0170.01116.02
5.6.390.0150.00915.94
5.6.380.0180.00915.89
5.6.370.0160.01016.18
5.6.360.0180.00916.29
5.6.350.0170.01016.26
5.6.340.0190.00616.29
5.6.330.0170.01116.33
5.6.320.0170.00916.33
5.6.310.0190.00916.27
5.6.300.0160.00816.21
5.6.290.0150.01016.30
5.6.280.0180.00616.33
5.6.270.0180.01116.26
5.6.260.0190.00516.34
5.6.250.0190.00716.29
5.6.240.0190.01016.30
5.6.230.0160.01016.31
5.6.220.0190.00816.27
5.6.210.0180.00916.25
5.6.200.0140.01216.23
5.6.190.0120.01416.30
5.6.180.0200.00716.38
5.6.170.0170.01216.31
5.6.160.0140.01116.26
5.6.150.0120.01216.33
5.6.140.0170.00716.19
5.6.130.0160.01016.36
5.6.120.0200.00716.25
5.6.110.0130.01316.19
5.6.100.0180.00816.32
5.6.90.0230.00616.14
5.6.80.0170.00816.25
5.6.70.0180.00616.18
5.6.60.0200.00516.23
5.6.50.0170.00816.22
5.6.40.0140.01016.26
5.6.30.0160.01016.21
5.6.20.0160.00916.29
5.6.10.0180.00616.19
5.6.00.0170.00716.17

preferences:
45.96 ms | 401 KiB | 5 Q