3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "This is a string\n with newline\n" . "\xC2\xA0" . "and special character\n"; $cleaned_string = preg_replace(['/\R/u', '/\xC2\xA0/u'], ['/n', ''], $string); var_dump($string, $cleaned_string);

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.5.10.0020.00616.87
8.5.00.0080.01420.14
8.4.150.0020.00014.05
8.4.140.0150.01117.78
8.4.130.0090.00917.85
8.4.120.0050.00522.41
8.4.110.0120.00818.75
8.4.100.0030.00620.42
8.4.90.0140.00718.84
8.4.80.0120.00818.60
8.4.70.0130.00718.14
8.4.60.0120.01118.92
8.4.50.0130.00718.52
8.4.40.0190.00017.48
8.4.30.0090.00920.38
8.4.20.0100.01017.86
8.4.10.0130.00619.32
8.3.280.0110.01118.43
8.3.270.0150.00916.63
8.3.260.0090.01016.65
8.3.250.0090.00918.93
8.3.240.0070.01216.74
8.3.230.0140.00516.50
8.3.220.0070.00118.84
8.3.210.0110.00718.57
8.3.200.0100.01016.69
8.3.190.0140.00517.03
8.3.180.0110.00516.86
8.3.170.0130.00620.57
8.3.160.0110.00717.10
8.3.150.0040.01118.88
8.3.140.0100.01018.78
8.3.130.0030.00616.82
8.3.120.0110.00020.50
8.3.110.0060.00320.94
8.3.100.0130.00724.06
8.3.90.0080.00326.77
8.3.80.0040.00718.43
8.3.70.0060.01216.50
8.3.60.0110.00418.51
8.3.50.0160.00616.85
8.3.40.0070.00721.86
8.3.30.0070.00720.34
8.3.20.0130.00625.66
8.3.10.0070.01125.66
8.3.00.0130.00725.66
8.2.290.0060.00220.59
8.2.280.0120.00718.58
8.2.270.0090.00917.24
8.2.260.0080.00016.63
8.2.250.0110.00716.89
8.2.240.0150.00418.75
8.2.230.0080.00022.58
8.2.220.0060.00337.54
8.2.210.0000.00826.77
8.2.200.0100.00018.66
8.2.190.0080.00816.88
8.2.180.0040.01516.75
8.2.170.0110.00418.95
8.2.160.0100.00722.96
8.2.150.0130.00725.66
8.2.140.0130.00725.66
8.2.130.0140.00725.66
8.2.120.0180.00325.66
8.2.110.0110.01125.66
8.2.100.0160.00625.66
8.2.90.0120.01225.66
8.2.80.0140.00725.66
8.2.70.0120.00625.66
8.2.60.0130.00625.66
8.2.50.0000.01525.66
8.2.40.0130.00625.66
8.2.30.0070.00725.66
8.2.20.0150.00325.66
8.2.10.0110.00425.66
8.2.00.0120.00325.66
8.1.330.0060.01021.93
8.1.320.0110.01016.42
8.1.310.0040.01118.41
8.1.300.0030.00517.87
8.1.290.0000.00930.84
8.1.280.0000.01425.92
8.1.270.0100.01025.66
8.1.260.0110.00325.66
8.1.250.0110.00425.66
8.1.240.0100.01025.66
8.1.230.0090.00925.66
8.1.220.0110.00725.66
8.1.210.0130.00625.66
8.1.200.0070.01125.66
8.1.190.0100.00725.66
8.1.180.0120.00425.66
8.1.170.0100.01025.66
8.1.160.0060.01025.66
8.1.150.0130.00325.66
8.1.140.0090.00925.66
8.1.130.0130.00325.66
8.1.120.0090.00625.66
8.1.110.0100.00725.66
8.1.100.0130.00325.66
8.1.90.0070.01025.66
8.1.80.0000.01525.66
8.1.70.0120.00325.66
8.1.60.0000.01525.66
8.1.50.0120.00325.66
8.1.40.0130.00325.66
8.1.30.0130.00625.66
8.1.20.0070.01025.66
8.1.10.0160.00025.66
8.1.00.0070.00725.66

preferences:
86.14 ms | 403 KiB | 5 Q