3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file = file_put_contents("/in/qF7aJ/myfile.txt", "testteststasfasdaskdjfbasdlkfbaslkdcjnbal;dfn"); $tmpFile = file_put_contents("/in/qF7aJ/mytmpfile.txt",""); $old = fopen($file, 'r'); $new = fopen($tmpFile, 'w'); while (!feof($old)) { // Your search subject $subject = ''; // Get $numChars for($x = 0, $numChars = 100; $x < $numChars; $x++){ $subject .= fgetc($old); } // Replace and write to $new fwrite($new, preg_replace('/[^\P{Cc}\t\r\n]/u', '', $subject)); // Clean out the characters $subject = ''; } rename($tmpFile, $file);

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.0110.00418.30
8.3.50.0110.01121.13
8.3.40.0080.00818.84
8.3.30.0160.00319.22
8.3.20.0000.01820.24
8.3.10.0030.00521.92
8.3.00.0080.00019.38
8.2.180.0180.00318.79
8.2.170.0180.00422.96
8.2.160.0070.00720.57
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0040.00422.07
8.2.110.0090.00319.45
8.2.100.0080.00317.78
8.2.90.0080.00017.84
8.2.80.0040.00417.97
8.2.70.0080.00017.63
8.2.60.0050.00317.68
8.2.50.0030.00518.07
8.2.40.0000.00818.09
8.2.30.0000.00817.92
8.2.20.0070.00017.60
8.2.10.0030.00518.00
8.2.00.0040.00417.67
8.1.280.0170.00325.92
8.1.270.0030.00523.84
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0000.01022.65
8.1.230.0090.00320.97
8.1.220.0040.00417.74
8.1.210.0040.00718.77
8.1.200.0100.00017.22
8.1.190.0050.00317.23
8.1.180.0060.00318.10
8.1.170.0030.00718.48
8.1.160.0070.00021.87
8.1.150.0060.00318.78
8.1.140.0040.00417.40
8.1.130.0070.00017.88
8.1.120.0000.00817.34
8.1.110.0040.00417.33
8.1.100.0030.00317.40
8.1.90.0040.00417.42
8.1.80.0040.00317.41
8.1.70.0070.00017.27
8.1.60.0040.00417.56
8.1.50.0030.00617.52
8.1.40.0080.00017.54
8.1.30.0030.00517.54
8.1.20.0060.00317.62
8.1.10.0050.00517.61
8.1.00.0040.00417.56
8.0.300.0000.00719.89
8.0.290.0000.00716.75
8.0.280.0030.00318.50
8.0.270.0070.00017.17
8.0.260.0030.00317.17
8.0.250.0000.00717.02
8.0.240.0070.00016.99
8.0.230.0070.00016.96
8.0.220.0030.00616.90
8.0.210.0000.00616.94
8.0.200.0000.00716.93
8.0.190.0040.00417.07
8.0.180.0000.00816.87
8.0.170.0040.00417.03
8.0.160.0030.00316.92
8.0.150.0000.00716.91
8.0.140.0000.00716.91
8.0.130.0030.00313.33
8.0.120.0060.00316.94
8.0.110.0030.00516.78
8.0.100.0070.00016.96
8.0.90.0040.00416.83
8.0.80.0060.00916.97
8.0.70.0030.00616.98
8.0.60.0070.00017.03
8.0.50.0000.00816.77
8.0.30.0090.01017.02
8.0.20.0100.00917.40
8.0.10.0000.00717.14
8.0.00.0080.01116.84
7.4.330.0090.00015.00
7.4.320.0070.00716.69
7.4.300.0040.00416.62
7.4.290.0100.00516.48
7.4.280.0080.00016.57
7.4.270.0050.00216.55
7.4.260.0040.00716.67
7.4.250.0060.00316.41
7.4.240.0030.00516.63
7.4.230.0060.00616.73
7.4.220.0320.01516.50
7.4.210.0250.03316.63
7.4.200.0040.00416.58
7.4.160.0290.01116.75
7.4.150.0410.01317.40
7.4.140.0220.01617.86
7.4.130.0270.01016.57
7.4.120.0350.01116.77
7.4.110.0820.04016.58
7.4.100.0560.02116.55
7.4.90.0450.01116.61
7.4.80.0120.00819.39
7.4.70.0300.01116.73
7.4.60.0770.01616.66
7.4.50.0030.00516.65
7.4.40.0080.02416.64
7.4.30.0100.02116.68
7.4.00.0040.01514.70
7.3.330.0050.00313.45
7.3.320.0000.00613.50
7.3.310.0030.00716.33
7.3.300.0090.00016.59
7.3.290.0150.00016.49
7.3.280.0150.01816.54
7.3.270.0560.00917.40
7.3.260.0470.00516.75
7.3.250.0360.01716.40
7.3.240.0310.01916.70
7.3.230.0170.00716.70
7.3.210.0660.01816.45
7.3.200.0580.01119.39
7.3.190.0100.01316.61
7.3.180.0080.01516.46
7.3.170.0570.03316.66
7.3.160.0370.01216.63
7.2.330.0050.02216.76
7.2.320.0530.00616.61
7.2.310.0250.01516.94
7.2.300.0130.01016.82
7.2.290.0360.00916.77
7.2.60.0000.01516.82
7.2.00.0030.01319.46
7.1.200.0060.00915.95
7.1.100.0040.00818.19
7.1.70.0040.00417.33
7.1.60.0230.00419.32
7.1.50.0100.01717.29
7.1.00.0000.08022.46
7.0.200.0080.00316.94
7.0.140.0030.07321.96
7.0.60.0070.07319.96
7.0.50.0070.04017.86
7.0.40.0300.06319.81
7.0.30.0570.06719.91
7.0.20.0200.04320.04
7.0.10.0330.03719.83
7.0.00.0100.05719.79
5.6.280.0070.07320.91
5.6.210.0130.07320.46
5.6.200.0130.08018.17
5.6.190.0130.05020.37
5.6.180.0200.08320.16
5.6.170.0300.05020.38
5.6.160.0070.05320.27
5.6.150.0070.03718.16
5.6.140.0100.06018.07
5.6.130.0170.07718.16
5.6.120.0170.06720.99
5.6.110.0130.05721.00
5.6.100.0270.06320.97
5.6.90.0030.06320.98
5.6.80.0100.07020.28
5.6.70.4370.03320.47
5.5.350.0070.06320.35
5.5.340.0100.07317.94
5.5.330.0030.07320.20
5.5.320.0300.04720.06
5.5.310.0170.05020.16
5.5.300.0200.04317.87
5.5.290.0070.08017.89
5.5.280.0100.08020.86
5.5.270.0100.04020.79
5.5.260.0100.03720.86
5.5.250.0100.08320.61
5.5.240.0100.08320.18
5.4.450.0270.06019.28
5.4.440.4330.04019.29
5.4.430.0370.05719.34
5.4.420.0300.07719.04
5.4.410.0230.08019.00
5.4.400.0400.06018.97
5.4.390.4300.03318.87
5.4.380.0300.07719.15
5.4.370.0230.08019.06
5.4.360.0500.07018.82
5.4.350.0330.05318.96
5.4.340.0170.06318.73
5.4.320.0060.03812.46
5.4.310.0090.04312.46
5.4.300.0060.04112.46
5.4.290.0040.04112.46
5.4.280.0040.04012.36
5.4.270.0090.03712.36
5.4.260.0080.04712.36
5.4.250.0070.04312.36
5.4.240.0050.04012.36
5.4.230.0080.03712.35
5.4.220.0040.04212.35
5.4.210.0090.04212.35
5.4.200.0100.03512.35
5.4.190.0060.04312.34
5.4.180.0100.03812.34
5.4.170.0070.03912.36
5.4.160.0080.03512.36
5.4.150.0090.03612.35
5.4.140.0090.03612.04
5.4.130.0080.03912.02
5.4.120.0030.04211.98
5.4.110.0090.03411.98
5.4.100.0090.03811.97
5.4.90.0170.03316.40
5.4.80.0030.05716.34
5.4.70.0070.07016.36
5.4.60.0430.05016.37
5.4.50.0030.07716.33
5.4.40.0030.07016.34
5.4.30.0270.06716.25
5.4.20.0300.04716.24
5.4.10.4170.03316.28
5.4.00.3300.02715.78

preferences:
39.04 ms | 401 KiB | 5 Q