3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file = file_put_contents("myfile.txt", "testteststasfasdaskdjfbasdlkfbaslkdcjnbal;dfn"); $tmpFile = file_put_contents("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.70.0120.00616.63
8.3.60.0070.00718.30
8.3.50.0140.00721.12
8.3.40.0040.01118.88
8.3.30.0080.00619.22
8.3.20.0040.01420.19
8.3.10.0050.00322.09
8.3.00.0050.00319.26
8.2.180.0040.01818.54
8.2.170.0110.00322.96
8.2.160.0140.00320.53
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0050.00326.16
8.2.120.0050.00322.09
8.2.110.0000.00820.52
8.2.100.0000.01117.97
8.2.90.0040.00419.17
8.2.80.0040.00417.97
8.2.70.0040.00417.63
8.2.60.0050.00317.68
8.2.50.0040.00418.07
8.2.40.0030.00518.03
8.2.30.0040.00417.90
8.2.20.0040.00417.74
8.2.10.0040.00418.11
8.2.00.0040.00417.69
8.1.280.0070.01025.92
8.1.270.0080.00023.71
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0080.00023.87
8.1.230.0040.00719.14
8.1.220.0050.00317.74
8.1.210.0000.00918.77
8.1.200.0000.00817.21
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0040.00418.49
8.1.160.0070.00021.96
8.1.150.0000.00818.83
8.1.140.0060.00317.35
8.1.130.0000.00717.83
8.1.120.0070.00017.46
8.1.110.0060.00317.36
8.1.100.0000.00717.46
8.1.90.0000.00717.36
8.1.80.0080.00017.44
8.1.70.0030.00317.37
8.1.60.0030.00617.54
8.1.50.0050.00317.55
8.1.40.0000.00817.42
8.1.30.0060.00317.63
8.1.20.0080.00017.70
8.1.10.0040.00417.61
8.1.00.0040.00417.50
8.0.300.0000.00818.77
8.0.290.0050.00216.75
8.0.280.0000.00718.38
8.0.270.0070.00017.25
8.0.260.0030.00317.33
8.0.250.0000.00716.90
8.0.240.0030.00317.01
8.0.230.0070.00016.91
8.0.220.0040.00416.95
8.0.210.0030.00316.97
8.0.200.0050.00216.91
8.0.190.0000.00817.02
8.0.180.0040.00416.97
8.0.170.0050.00316.92
8.0.160.0030.00516.93
8.0.150.0070.00016.83
8.0.140.0030.00516.91
8.0.130.0000.00713.46
8.0.120.0080.00017.02
8.0.110.0040.00416.96
8.0.100.0080.00016.77
8.0.90.0040.00416.96
8.0.80.0090.01517.01
8.0.70.0050.00317.02
8.0.60.0040.00416.96
8.0.50.0070.00017.00
8.0.30.0140.00917.13
8.0.20.0110.00817.40
8.0.10.0040.00417.00
8.0.00.0070.01216.78
7.4.330.0000.00815.00
7.4.320.0070.00416.59
7.4.300.0050.00916.57
7.4.290.0050.00516.59
7.4.280.0040.00816.55
7.4.270.0050.00316.50
7.4.260.0040.01216.67
7.4.250.0000.01416.59
7.4.240.0010.00716.55
7.4.230.0110.00016.79
7.4.220.0170.00316.63
7.4.210.0140.00416.73
7.4.200.0120.00016.38
7.4.160.0140.00716.73
7.4.150.0100.01417.40
7.4.140.0100.01717.86
7.4.130.0220.01316.76
7.4.120.0150.01116.62
7.4.110.0200.00816.61
7.4.100.0150.01216.51
7.4.90.0060.01516.49
7.4.80.0660.00519.39
7.4.70.0220.01516.59
7.4.60.0790.02916.60
7.4.50.0090.00016.48
7.4.40.0100.00716.48
7.4.30.0350.01016.51
7.3.330.0050.00513.45
7.3.320.0000.00713.36
7.3.310.0070.00216.44
7.3.300.0000.00816.50
7.3.290.0270.02716.46
7.3.280.0170.01016.56
7.3.270.0450.00917.40
7.3.260.0350.01816.42
7.3.250.0270.01416.66
7.3.240.0130.01016.33
7.3.230.0240.00616.53
7.3.210.0600.00316.66
7.3.200.1160.00719.39
7.3.190.0320.02816.54
7.3.180.0190.02016.55
7.3.170.0330.01116.67
7.3.160.0150.02516.68
7.2.330.0930.03016.80
7.2.320.0240.02916.84
7.2.310.0410.01316.80
7.2.300.0140.01716.74
7.2.290.0150.02816.83
7.1.70.0060.00617.21
7.1.60.0090.00617.61
7.1.50.0090.00617.21
7.1.40.0040.00817.21
7.1.30.0060.00617.05
7.1.20.0080.01617.16
7.1.10.0030.00817.75
7.1.00.0060.00617.89
7.0.200.0030.00717.05
7.0.190.0030.00816.96
7.0.180.0100.00216.64
7.0.170.0130.00516.52
7.0.160.0000.00916.64
7.0.150.0000.01017.75
7.0.140.0080.00517.75
7.0.130.0060.00317.89
7.0.120.0000.01017.89
7.0.110.0000.01117.89
7.0.100.0070.00717.89
7.0.90.0000.00917.89
7.0.80.0060.00917.89
7.0.70.0110.00517.89
7.0.60.0030.01017.89
7.0.50.0120.00417.90
7.0.40.0000.01317.90
7.0.30.0050.01017.90
7.0.20.0030.01417.90
7.0.10.0040.01617.90
7.0.00.0090.00917.90
5.6.300.0030.04520.55
5.6.290.0270.03320.49
5.6.280.0000.04420.69
5.6.270.0030.04220.70
5.6.260.0090.04120.57
5.6.250.0070.04020.70
5.6.240.0070.04120.61
5.6.230.0070.05020.72
5.6.220.0060.04220.65
5.6.210.0030.04420.70
5.6.200.0070.04620.67
5.6.190.0070.04320.66
5.6.180.0100.05720.66
5.6.170.0070.06220.65
5.6.160.0030.04920.56
5.6.150.0100.04120.56
5.6.140.0100.05120.66
5.6.130.0070.04720.59
5.6.120.0100.04920.66
5.6.110.0030.04920.54
5.6.100.0150.05220.62
5.6.90.0130.07620.68
5.6.80.0070.04119.97
5.6.70.0070.06519.93
5.6.60.0090.04219.92
5.6.50.0000.04619.98
5.6.40.0100.04719.96
5.6.30.0070.04319.92
5.6.20.0130.06920.04
5.6.10.0000.04219.90
5.6.00.0000.04220.20
5.5.380.0100.05317.89
5.5.370.0000.05117.89
5.5.360.0070.04017.89
5.5.350.0090.03217.90
5.5.340.0030.04317.90
5.5.330.0000.04617.90
5.5.320.0070.05917.90
5.5.310.0060.05517.90
5.5.300.0190.04717.90
5.5.290.0030.04817.90
5.5.280.0100.04517.90
5.5.270.0030.05117.90
5.5.260.0070.04217.90
5.5.250.0100.05417.90
5.5.240.0130.10017.90
5.5.230.0070.04117.90
5.5.220.0070.03417.90
5.5.210.0000.04917.90
5.5.200.0000.03917.90
5.5.190.0070.03817.90
5.5.180.0000.04717.90
5.5.160.0190.03817.90
5.5.150.0030.04317.90
5.5.140.0100.04817.90
5.5.130.0030.03817.90
5.5.120.0040.04317.90
5.5.110.0000.04217.90
5.5.100.0030.03817.90
5.5.90.0100.05117.90
5.5.80.0000.04117.90
5.5.70.0160.04517.90
5.5.60.0060.05817.90
5.5.50.0030.04517.90
5.5.40.0000.04117.90
5.5.30.0030.04117.90
5.5.20.0100.04317.90
5.5.10.0040.03917.90
5.5.00.0070.04117.90
5.4.450.0000.04619.21
5.4.440.0070.04418.96
5.4.430.0000.04118.91
5.4.420.0160.06519.24
5.4.410.0000.04619.03
5.4.400.0070.07018.52
5.4.390.0000.04518.95
5.4.380.0030.03918.88
5.4.370.0030.04018.50
5.4.360.0030.07518.59
5.4.350.0070.05818.53
5.4.340.0060.04918.64
5.4.320.0030.04818.64
5.4.310.0030.04118.63
5.4.300.0070.05518.71
5.4.290.0030.05618.69
5.4.280.0000.06218.58
5.4.270.0060.03818.71
5.4.260.0030.03818.57
5.4.250.0070.05018.59
5.4.240.0000.08418.67
5.4.230.0030.06918.84
5.4.220.0000.05518.83
5.4.210.0000.04618.67
5.4.200.0030.03918.71
5.4.190.0070.07018.70
5.4.180.0030.03818.54
5.4.170.0030.03818.87
5.4.160.0030.03918.86
5.4.150.0030.03818.57
5.4.140.0090.03217.90
5.4.130.0060.03817.90
5.4.120.0000.03817.90
5.4.110.0030.03717.90
5.4.100.0060.04617.90
5.4.90.0030.03417.90
5.4.80.0030.04017.90
5.4.70.0060.03217.90
5.4.60.0000.03917.90
5.4.50.0070.03717.90
5.4.40.0000.04317.90
5.4.30.0000.03917.90
5.4.20.0030.03517.90
5.4.10.0070.03117.90
5.4.00.0030.04717.90

preferences:
40.83 ms | 401 KiB | 5 Q