3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file = file_put_contents("testteststasfasdaskdjfbasdlkfbaslkdcjnbal;dfn"); $tmpFile = file_put_contents(""); $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.0110.00416.63
8.3.60.0040.01118.31
8.3.50.0130.00721.22
8.3.40.0120.00318.75
8.3.30.0170.00319.04
8.3.20.0070.00020.04
8.3.10.0040.00422.04
8.3.00.0050.00319.26
8.2.180.0140.00718.41
8.2.170.0060.00922.96
8.2.160.0110.00720.28
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0040.00422.06
8.2.110.0100.00019.22
8.2.100.0060.00617.91
8.2.90.0090.00017.91
8.2.80.0000.00817.97
8.2.70.0040.00417.80
8.2.60.0000.00717.80
8.2.50.0030.00618.10
8.2.40.0050.00320.33
8.2.30.0040.00417.98
8.2.20.0040.00417.66
8.2.10.0040.00417.99
8.2.00.0000.00717.73
8.1.280.0100.00725.92
8.1.270.0040.00423.92
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00722.14
8.1.230.0030.00820.81
8.1.220.0060.00317.74
8.1.210.0030.00520.55
8.1.200.0080.00017.22
8.1.190.0000.00816.88
8.1.180.0080.00018.10
8.1.170.0030.00518.46
8.1.160.0040.00421.82
8.1.150.0100.00018.82
8.1.140.0000.00717.18
8.1.130.0030.00317.76
8.1.120.0030.00417.34
8.1.110.0000.00717.23
8.1.100.0000.00717.38
8.1.90.0040.00417.36
8.1.80.0000.00717.23
8.1.70.0000.00717.34
8.1.60.0030.00617.44
8.1.50.0030.00517.46
8.1.40.0050.00317.45
8.1.30.0030.00617.46
8.1.20.0070.00017.57
8.1.10.0040.00417.49
8.1.00.0000.00717.46
8.0.300.0030.00519.89
8.0.290.0000.00716.75
8.0.280.0000.00718.37
8.0.270.0000.00716.82
8.0.260.0040.00417.19
8.0.250.0050.00316.96
8.0.240.0040.00416.97
8.0.230.0000.00716.95
8.0.220.0000.00816.82
8.0.210.0000.00716.88
8.0.200.0000.00716.96
8.0.190.0000.00716.95
8.0.180.0040.00416.90
8.0.170.0040.00416.93
8.0.160.0020.00516.82
8.0.150.0070.00016.83
8.0.140.0040.00416.75
8.0.130.0030.00313.31
8.0.120.0050.00316.88
8.0.110.0050.00216.77
8.0.100.0050.00216.69
8.0.90.0070.00016.98
8.0.80.0190.00316.93
8.0.70.0060.00316.88
8.0.60.0030.00316.84
8.0.50.0000.00816.82
8.0.30.0090.01216.96
8.0.20.0070.01317.40
8.0.10.0000.00716.98
8.0.00.0130.00816.64
7.4.330.0050.00215.12
7.4.320.0050.01016.50
7.4.300.0030.00516.65
7.4.290.0050.01016.51
7.4.280.0030.00516.59
7.4.270.0090.00316.58
7.4.260.0000.01316.71
7.4.250.0140.00016.59
7.4.240.0020.00716.48
7.4.230.0050.00716.57
7.4.220.0120.00616.58
7.4.210.0100.01016.57
7.4.200.0040.00816.45
7.4.160.0090.02716.52
7.4.150.0080.02317.40
7.4.140.0350.01717.86
7.4.130.0160.01416.64
7.4.120.0360.01016.57
7.4.110.0190.02016.60
7.4.100.0490.00916.57
7.4.90.0970.02816.46
7.4.80.0240.00619.39
7.4.70.0400.02416.63
7.4.60.0320.01116.74
7.4.50.0050.00516.39
7.4.40.0520.02116.81
7.4.30.0750.02516.54
7.3.330.0030.00513.52
7.3.320.0050.00213.45
7.3.310.0000.01316.55
7.3.300.0040.00416.34
7.3.290.0050.02716.48
7.3.280.0140.01616.51
7.3.270.0250.01917.40
7.3.260.0460.02116.63
7.3.250.0360.01216.63
7.3.240.0140.01816.44
7.3.230.0630.02116.70
7.3.210.0490.01716.50
7.3.200.0680.00919.39
7.3.190.0950.02216.67
7.3.180.0120.00916.25
7.3.170.0220.01616.59
7.3.160.0060.01416.51
7.2.330.0170.00616.75
7.2.320.0210.01516.72
7.2.310.0070.01416.70
7.2.300.0510.01916.85
7.2.290.0270.01916.86
7.0.120.0030.07722.20
7.0.110.0030.08022.03
7.0.100.0000.07322.16
7.0.90.0000.07022.07
7.0.80.0030.06722.19
7.0.70.0100.06722.16
7.0.60.0100.05722.12
7.0.50.0070.06722.08
7.0.40.0030.07721.98
7.0.30.0030.06722.21
7.0.20.0030.07322.15
7.0.10.0100.07022.07
7.0.00.0030.07721.98
5.6.260.0070.07020.87
5.6.250.0100.06721.04
5.6.240.0000.08020.93
5.6.230.0100.07321.11
5.6.220.0100.07021.11
5.6.210.0030.06320.96
5.6.200.0070.05020.94
5.6.190.0000.08020.93
5.6.180.0070.06320.83
5.6.170.0030.06320.97
5.6.160.0100.06721.03
5.6.150.0030.07720.99
5.6.140.0100.07321.07
5.6.130.0070.07020.92
5.6.120.0000.07320.93
5.6.110.0000.06721.04
5.6.100.0070.06721.06
5.6.90.0070.07320.77
5.6.80.0030.06720.21
5.6.70.0070.07020.34
5.6.60.0030.07320.27
5.6.50.0070.07020.38
5.6.40.0070.06720.25
5.6.30.0070.07020.29
5.6.20.0000.07320.14
5.6.10.0070.06720.42
5.6.00.0000.07320.24
5.5.380.0070.07017.58
5.5.370.0100.06717.46
5.5.360.0030.07717.45
5.5.350.0000.07017.47
5.5.340.0000.07718.06
5.5.330.0100.04318.09
5.5.320.0000.07717.85
5.5.310.0000.07318.00
5.5.300.0070.07018.06
5.5.290.0100.06017.83
5.5.280.0100.06718.00
5.5.270.0070.07317.83
5.5.260.0070.07317.73
5.5.250.0000.08017.67
5.5.240.0070.05317.13
5.5.230.0070.07017.13
5.5.220.0000.07317.43
5.5.210.0070.06317.21
5.5.200.0030.07017.45
5.5.190.0000.07717.26
5.5.180.0000.07017.39
5.5.160.0070.07017.41
5.5.150.0030.07017.16
5.5.140.0070.06317.18
5.5.130.0030.06017.26
5.5.120.0130.06017.16
5.5.110.0030.07017.34
5.5.100.0070.06317.07
5.5.90.0000.07017.34
5.5.80.0000.07317.30
5.5.70.0070.06717.26
5.5.60.0070.06017.25
5.5.50.0100.06017.30
5.5.40.0000.07017.08
5.5.30.0000.07017.21
5.5.20.0070.07017.05
5.5.10.0000.07717.05
5.5.00.0170.06017.26
5.4.450.0030.07719.24
5.4.440.0030.07719.53
5.4.430.0070.07019.52
5.4.420.0000.05319.28
5.4.410.0030.07019.12
5.4.400.0030.06019.21
5.4.390.0070.07019.20
5.4.380.0000.07318.95
5.4.370.0100.06318.86
5.4.360.0070.07019.20
5.4.350.0000.07018.89
5.4.340.0000.07718.93
5.4.320.0030.06318.91
5.4.310.0100.06318.80
5.4.300.0030.06319.20
5.4.290.0070.06718.93
5.4.280.0000.07318.91
5.4.270.0070.06718.96
5.4.260.0000.07019.20
5.4.250.0030.07019.02
5.4.240.0000.07019.00
5.4.230.0070.06318.83
5.4.220.0070.07018.75
5.4.210.0030.07018.94
5.4.200.0070.06319.11
5.4.190.0030.06318.88
5.4.180.0030.06718.91
5.4.170.0100.06319.02
5.4.160.0000.07318.89
5.4.150.0100.06319.18
5.4.140.0030.07016.35
5.4.130.0030.06016.44
5.4.120.0030.06716.12
5.4.110.0000.07016.15
5.4.100.0070.06316.50
5.4.90.0100.06016.27
5.4.80.0030.06716.32
5.4.70.0070.06316.32
5.4.60.0030.06316.29
5.4.50.0030.06716.39
5.4.40.0030.06716.46
5.4.30.0070.06016.43
5.4.20.0030.06716.41
5.4.10.0070.06716.28
5.4.00.0070.06015.65

preferences:
68.76 ms | 401 KiB | 5 Q