3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file = file_put_contents("/tmp/myfile.txt", "testteststasfasdaskdjfbasdlkfbaslkdcjnbal;dfn"); $tmpFile = file_put_contents("/tmp/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.0100.00318.30
8.3.50.0090.01216.36
8.3.40.0120.00618.79
8.3.30.0060.00819.13
8.3.20.0120.00620.33
8.3.10.0050.00321.96
8.3.00.0040.00419.50
8.2.180.0090.01218.76
8.2.170.0120.00322.96
8.2.160.0120.00320.45
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0080.00020.98
8.2.110.0000.00919.36
8.2.70.0120.00618.45
8.2.60.0130.00418.74
8.2.50.0050.01418.54
8.2.40.0130.00418.36
8.2.30.0150.00318.64
8.2.20.0110.00518.51
8.2.10.0000.01718.60
8.2.00.0000.01818.45
8.1.280.0140.00325.92
8.1.270.0040.00423.79
8.1.260.0080.00026.35
8.1.250.0030.00528.09
8.1.240.0040.00419.01
8.1.200.0140.00318.25
8.1.190.0160.00018.30
8.1.180.0100.00718.25
8.1.170.0100.00718.38
8.1.160.0120.00418.27
8.1.150.0100.00618.25
8.1.140.0120.00418.42
8.1.130.0110.00618.25
8.1.120.0080.00818.58
8.1.110.0050.01118.51
8.1.100.0110.00618.29
8.1.90.0100.00519.70
8.1.80.0170.00018.35
8.1.70.0110.00618.25
8.1.60.0040.01318.39
8.1.50.0090.00918.28
8.1.40.0080.00818.61
8.1.30.0070.00220.57
8.1.20.0120.00318.32
8.1.10.0020.00720.31
8.1.00.0090.00020.39
8.0.290.0110.00318.25
8.0.280.0050.00519.65
8.0.270.0080.00618.25
8.0.260.0030.00619.90
8.0.250.0000.01318.25
8.0.240.0000.00919.88
8.0.230.0030.00619.86
8.0.220.0060.00618.25
8.0.210.0040.00419.69
8.0.200.0040.00419.88
8.0.190.0050.01018.25
8.0.180.0040.00418.25
8.0.170.0120.00418.25
8.0.160.0000.00919.96
8.0.150.0130.00218.25
8.0.140.0080.00019.83
8.0.130.0000.00819.85
8.0.120.0110.00418.25
8.0.110.0090.00019.93
8.0.100.0000.01418.25
8.0.90.0070.00218.25
8.0.80.0090.00019.88
8.0.70.0140.00018.25
8.0.60.0000.01019.89
8.0.50.0070.00718.25
8.0.30.0000.00919.55
8.0.20.0060.00319.77
8.0.10.0040.00918.25
8.0.00.0120.00418.25
7.4.330.0160.00018.25
7.4.320.0110.00718.25
7.4.300.0090.00918.25
7.4.290.0110.00718.25
7.4.280.0090.00918.25
7.4.270.0130.00918.25
7.4.260.0130.00318.25
7.4.250.0160.00718.25
7.4.240.0090.00918.25
7.4.230.0190.00318.25
7.4.220.0190.00018.25
7.4.210.0260.00018.25
7.4.200.0120.00818.25
7.4.190.0130.00418.25
7.4.180.0100.00518.25
7.4.160.0180.00018.25
7.4.150.0140.00418.25
7.4.140.0060.01218.25
7.4.130.0120.00618.25
7.4.120.0180.00018.25
7.4.110.0170.00218.25
7.4.100.0090.00918.25
7.4.90.0100.01018.25
7.4.80.0150.00418.25
7.4.70.0180.00318.25
7.4.60.0040.01618.25
7.4.50.0120.00418.25
7.4.40.0160.00318.25
7.4.30.0140.00018.25
7.4.20.0070.00718.25
7.4.10.0180.00518.25
7.4.00.0150.00618.25
7.3.330.0060.01218.25
7.3.320.0170.00318.25
7.3.310.0130.00318.25
7.3.300.0150.00618.25
7.3.290.0150.00618.25
7.3.280.0140.00918.25
7.3.270.0150.00518.25
7.3.260.0120.00818.25
7.3.250.0070.01418.25
7.3.240.0160.00518.25
7.3.230.0130.00618.25
7.3.220.0080.00818.25
7.3.210.0140.01018.25
7.3.200.0090.00918.25
7.3.190.0170.00318.25
7.3.180.0130.00918.25
7.3.170.0150.00318.25
7.3.160.0210.00018.25
7.3.150.0160.00018.25
7.3.140.0180.00518.25
7.3.130.0140.00718.25
7.3.120.0140.00918.25
7.3.110.0160.00418.25
7.3.100.0180.00218.25
7.3.90.0160.00418.25
7.3.80.0170.00418.25
7.3.70.0140.00718.25
7.3.60.0120.00418.25
7.3.50.0170.00018.25
7.3.40.0050.01418.25
7.3.30.0250.00018.25
7.3.20.0100.00519.29
7.3.10.0160.00218.93
7.3.00.0140.00519.06
7.2.340.0160.00418.25
7.2.330.0130.00318.25
7.2.320.0210.00018.25
7.2.310.0140.00718.25
7.2.300.0140.00718.25
7.2.290.0170.00618.25
7.2.280.0040.01418.25
7.2.270.0120.00418.25
7.2.260.0120.00818.25
7.2.250.0100.00518.25
7.2.240.0110.00818.25
7.2.230.0140.00718.25
7.2.220.0080.00818.25
7.2.210.0120.00818.25
7.2.200.0100.01018.25
7.2.190.0090.00618.25
7.2.180.0070.01118.25
7.2.170.0150.00518.25
7.2.160.0090.00718.25
7.2.150.0130.00619.34
7.2.140.0190.00019.49
7.2.130.0130.00719.37
7.2.120.0110.00519.56
7.2.110.0150.00219.41
7.2.100.0090.00919.48
7.2.90.0120.00819.16
7.2.80.0100.01019.32
7.2.70.0080.01219.46
7.2.60.0170.00719.18
7.2.50.0040.01419.39
7.2.40.0110.00819.35
7.2.30.0140.00419.25
7.2.20.0070.01419.59
7.2.10.0130.00619.26
7.2.00.0210.00019.35
7.1.330.0110.00718.25
7.1.320.0160.00318.25
7.1.310.0140.00018.25
7.1.300.0090.00618.25
7.1.290.0140.00718.25
7.1.280.0100.00718.25
7.1.270.0200.00018.25
7.1.260.0110.00818.25
7.1.250.0170.00018.25
7.1.240.0130.00318.26
7.1.230.0180.00418.25
7.1.220.0140.00518.49
7.1.210.0190.00018.25
7.1.200.0110.00518.27
7.1.190.0090.00918.25
7.1.180.0100.01018.48
7.1.170.0100.00518.25
7.1.160.0100.00518.25
7.1.150.0200.00018.25
7.1.140.0140.00318.25
7.1.130.0070.01418.25
7.1.120.0120.00618.25
7.1.110.0090.00918.27
7.1.100.0060.01318.38
7.1.90.0130.00318.25
7.1.80.0150.00518.32
7.1.70.0200.00018.25
7.1.60.0090.00918.47
7.1.50.0150.00318.46
7.1.40.0140.00418.25
7.1.30.0050.01318.37
7.1.20.0060.01218.30
7.1.10.0200.00018.35
7.1.00.0150.00318.26
7.0.330.0110.00418.25
7.0.320.0060.01218.25
7.0.310.0170.00318.25
7.0.300.0000.01518.25
7.0.290.0060.01018.25
7.0.280.0150.00018.25
7.0.270.0130.00418.25
7.0.260.0080.00818.25
7.0.250.0110.00518.25
7.0.240.0080.00818.25
7.0.230.0160.00318.25
7.0.220.0130.00718.25
7.0.210.0050.01018.25
7.0.200.0150.00518.25
7.0.190.0170.00018.25
7.0.180.0120.00618.25
7.0.170.0110.00418.26
7.0.160.0130.00418.25
7.0.150.0130.00318.25
7.0.140.0110.00418.25
7.0.130.0150.00518.25

preferences:
48.04 ms | 400 KiB | 5 Q