3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str ="it is a test string."; $y="r"; $x="m"; $len=strlen($str); if($str[0]==$y) { $str=substr_replace($str,$x,0,1); } if($len>=3) { for($i=3;$i<$len;$i+=4) { if($str[$i]==$y) { $str=substr_replace($str,$x,$i,1); } } } var_dump($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.4.20.0140.00717.72
8.4.10.0040.00417.73
8.3.150.0090.00919.11
8.3.140.0060.00317.25
8.3.130.0080.00018.27
8.3.120.0040.00420.68
8.3.110.0030.00518.57
8.3.100.0090.00324.06
8.3.90.0140.00426.77
8.3.80.0000.00918.68
8.3.70.0120.00616.75
8.3.60.0090.01216.50
8.3.50.0100.00822.11
8.3.40.0110.00418.85
8.3.30.0120.00318.84
8.3.20.0070.00020.29
8.3.10.0080.00023.48
8.3.00.0080.00019.38
8.2.260.0000.00818.25
8.2.250.0040.00417.07
8.2.240.0060.00317.32
8.2.230.0080.00020.94
8.2.220.0040.00437.54
8.2.210.0100.00726.77
8.2.200.0000.00916.38
8.2.190.0200.00016.88
8.2.180.0080.01116.63
8.2.170.0040.01122.96
8.2.160.0130.00720.36
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00419.68
8.2.110.0080.00022.08
8.2.100.0040.00717.91
8.2.90.0000.00919.28
8.2.80.0040.00417.97
8.2.70.0080.00017.38
8.2.60.0040.00417.91
8.2.50.0080.00018.07
8.2.40.0030.00619.39
8.2.30.0050.00220.64
8.2.20.0000.00917.74
8.2.10.0040.00418.12
8.2.00.0060.00318.18
8.1.310.0110.00716.58
8.1.300.0060.00320.37
8.1.290.0100.00330.84
8.1.280.0130.00725.92
8.1.270.0060.00323.82
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.01022.48
8.1.230.0090.00322.63
8.1.220.0040.00417.79
8.1.210.0090.00018.77
8.1.200.0000.01017.23
8.1.190.0080.00017.23
8.1.180.0030.00618.10
8.1.170.0070.00018.93
8.1.160.0000.00721.90
8.1.150.0030.00618.78
8.1.140.0000.00819.59
8.1.130.0030.00317.67
8.1.120.0040.00417.45
8.1.110.0050.00317.43
8.1.100.0020.00517.43
8.1.90.0040.00417.46
8.1.80.0000.00817.50
8.1.70.0070.00017.49
8.1.60.0000.00717.45
8.1.50.0000.00817.53
8.1.40.0040.00417.51
8.1.30.0040.00417.68
8.1.20.0000.00817.57
8.1.10.0000.00817.64
8.1.00.0080.00017.41
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0030.00318.30
8.0.270.0000.00717.22
8.0.260.0000.00917.20
8.0.250.0000.00716.93
8.0.240.0040.00416.82
8.0.230.0030.00316.91
8.0.220.0040.00416.75
8.0.210.0080.00016.86
8.0.200.0080.00016.87
8.0.190.0000.00816.93
8.0.180.0000.00716.76
8.0.170.0030.00516.84
8.0.160.0040.00416.91
8.0.150.0070.00016.69
8.0.140.0000.00716.86
8.0.130.0080.00013.31
8.0.120.0000.00716.82
8.0.110.0080.00016.87
8.0.100.0000.00716.66
8.0.90.0000.00716.83
8.0.80.0090.00916.83
8.0.70.0040.00416.88
8.0.60.0040.00416.90
8.0.50.0000.00716.90
8.0.30.0110.00817.12
8.0.20.0110.01217.40
8.0.10.0000.00716.80
8.0.00.0080.00916.72
7.4.330.0030.00316.83
7.4.320.0030.00316.53
7.4.300.0040.00416.53
7.4.290.0040.00416.53
7.4.280.0050.00316.46
7.4.270.0000.00716.54
7.4.260.0030.00316.51
7.4.250.0040.00416.62
7.4.240.0030.00316.50
7.4.230.0080.00016.66
7.4.220.0090.00916.64
7.4.210.0070.00716.64
7.4.200.0030.00316.64
7.4.160.0030.01316.50
7.4.150.0070.01017.40
7.4.140.0130.01017.86
7.4.130.0120.00516.64
7.4.120.0110.00616.60
7.4.110.0040.01316.49
7.4.100.0100.01316.38
7.4.90.0100.00716.42
7.4.80.0130.00619.39
7.4.70.0130.01016.64
7.4.60.0000.01516.56
7.4.50.0090.00616.54
7.4.40.0090.01216.43
7.4.30.0170.00016.76
7.4.00.0090.00614.80
7.3.330.0030.00613.21
7.3.320.0060.00013.28
7.3.310.0000.00716.43
7.3.300.0030.00316.28
7.3.290.0070.00816.33
7.3.280.0090.00816.34
7.3.270.0060.01217.40
7.3.260.0060.01616.64
7.3.250.0110.00716.51
7.3.240.0140.00616.50
7.3.230.0100.00716.39
7.3.210.0160.00616.43
7.3.200.0110.00716.48
7.3.190.0030.01316.23
7.3.180.0080.00816.22
7.3.170.0080.00816.39
7.3.160.0090.00616.45
7.3.10.0100.00316.63
7.3.00.0150.00016.68
7.2.330.0100.00716.66
7.2.320.0030.01716.66
7.2.310.0090.00616.66
7.2.300.0060.01116.72
7.2.290.0030.01616.70
7.2.130.0130.00316.66
7.2.120.0060.00916.99
7.2.110.0000.01616.77
7.2.100.0000.01016.64
7.2.90.0120.00316.82
7.2.80.0000.01416.72
7.2.70.0000.00916.92
7.2.60.0110.00016.91
7.2.50.0000.01416.77
7.2.40.0060.00317.05
7.2.30.0070.00716.74
7.2.20.0090.00616.95
7.2.10.0080.00816.67
7.2.00.0060.01216.95
7.1.250.0000.00915.68
7.1.200.0160.00515.43
7.1.100.0060.01018.16
7.1.70.0040.00416.97
7.1.60.0070.00317.38
7.1.50.0060.01616.95
7.1.00.0070.07322.41
7.0.200.0050.00216.73
7.0.60.0030.04019.93
7.0.50.0070.04317.80
7.0.40.0000.05320.23
7.0.30.0430.07020.34
7.0.20.0200.06720.41
7.0.10.0100.08320.32
7.0.00.0000.04720.16
5.6.280.0000.06020.86
5.6.210.0200.06720.50
5.6.200.0100.08318.09
5.6.190.0130.06720.27
5.6.180.0530.06320.63
5.6.170.0300.05720.61
5.6.160.0130.07720.50
5.6.150.0000.07018.09
5.6.140.0030.05718.12
5.6.130.0170.07718.09
5.6.120.0100.07720.99
5.6.110.0070.04720.97
5.6.100.0100.08321.12
5.6.90.0070.03720.98
5.6.80.0070.08020.37
5.5.350.4200.04320.50
5.5.340.0200.06717.88
5.5.330.0070.05720.53
5.5.320.0000.04720.21
5.5.310.0200.04320.30
5.5.300.0000.06018.00
5.5.290.0030.08317.86
5.5.280.0100.04020.68
5.5.270.0030.05020.76
5.5.260.0170.08020.72
5.5.250.0130.08320.54
5.5.240.0170.04320.18

preferences:
36.13 ms | 403 KiB | 5 Q