3v4l.org

run code in 300+ PHP versions simultaneously
<?php $textbefore = "text has newlines in wo\nrds and normal newlines \n bewtween words and again in wo\nrds"; $textafter = preg_replace( "/(?<=\S)\n|\n(?=\S)/", '', $textbefore); var_dump( $textafter);

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.40.0040.01118.61
8.3.30.0040.01818.67
8.3.20.0060.00918.60
8.3.10.0060.00320.40
8.3.00.0050.00319.38
8.2.170.0030.01222.96
8.2.160.0180.00320.27
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0060.00321.23
8.2.110.0030.00721.13
8.2.100.0090.00318.03
8.2.90.0030.00617.97
8.2.80.0040.00419.05
8.2.70.0030.00617.75
8.2.60.0050.00317.63
8.2.50.0050.00317.75
8.2.40.0040.00422.43
8.2.30.0000.00717.92
8.2.20.0080.00317.75
8.2.10.0000.00817.77
8.2.00.0000.00817.69
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0040.00422.07
8.1.230.0040.00721.04
8.1.220.0030.00517.79
8.1.210.0050.00318.84
8.1.200.0080.00017.35
8.1.190.0060.00317.22
8.1.180.0000.00918.10
8.1.170.0080.00018.78
8.1.160.0040.00418.91
8.1.150.0100.00018.63
8.1.140.0000.00717.45
8.1.130.0070.00017.82
8.1.120.0000.00817.45
8.1.110.0030.00717.40
8.1.100.0030.00417.57
8.1.90.0000.00717.54
8.1.80.0070.00017.52
8.1.70.0000.00817.52
8.1.60.0040.00417.70
8.1.50.0000.00717.54
8.1.40.0050.00317.62
8.1.30.0040.00417.73
8.1.20.0000.00817.65
8.1.10.0040.00417.61
8.1.00.0030.00517.39
8.0.300.0040.00420.07
8.0.290.0040.00416.75
8.0.280.0070.00018.39
8.0.270.0030.00317.19
8.0.260.0030.00316.89
8.0.250.0040.00417.10
8.0.240.0080.00016.89
8.0.230.0030.00317.07
8.0.220.0030.00317.00
8.0.210.0080.00016.99
8.0.200.0000.00716.96
8.0.190.0040.00417.02
8.0.180.0000.00716.91
8.0.170.0040.00416.94
8.0.160.0040.00416.98
8.0.150.0080.00017.00
8.0.140.0030.00716.97
8.0.130.0030.00313.32
8.0.120.0000.00816.95
8.0.110.0070.00016.95
8.0.100.0000.00716.98
8.0.90.0050.00216.97
8.0.80.0100.01017.00
8.0.70.0000.00716.85
8.0.60.0050.00316.86
8.0.50.0090.00016.93
8.0.30.0130.01017.13
8.0.20.0090.01417.26
8.0.10.0040.00417.13
8.0.00.0120.00816.88
7.4.330.0050.00013.18
7.4.320.0000.00716.74
7.4.300.0030.00316.75
7.4.290.0000.00716.51
7.4.280.0040.00416.66
7.4.270.0020.00516.65
7.4.260.0030.00313.37
7.4.250.0050.00316.63
7.4.240.0000.00716.57
7.4.230.0070.00016.55
7.4.220.0100.01916.49
7.4.210.0060.00916.69
7.4.200.0060.00316.44
7.4.190.0000.00716.80
7.4.160.0090.00616.43
7.4.150.0090.00916.68
7.4.140.0040.01216.65
7.4.130.0130.00416.74
7.4.120.0100.00716.86
7.4.110.0100.00716.58
7.4.100.0090.00916.46
7.4.90.0090.01416.53
7.4.80.0070.01119.39
7.4.70.0070.01016.61
7.4.60.0080.00816.61
7.4.50.0060.00316.46
7.4.40.0050.00816.42
7.4.30.0090.00616.59
7.4.00.0000.01615.02
7.3.330.0030.00313.03
7.3.320.0030.00513.19
7.3.310.0000.00816.28
7.3.300.0000.00716.32
7.3.290.0070.00716.36
7.3.280.0080.01116.34
7.3.270.0090.00916.29
7.3.260.0030.01316.55
7.3.250.0130.00616.35
7.3.240.0070.01016.52
7.3.230.0150.00516.49
7.3.210.0110.00616.32
7.3.200.0030.01416.31
7.3.190.0030.01316.28
7.3.180.0100.00716.27
7.3.170.0070.00816.47
7.3.160.0070.01016.40
7.3.120.0030.01014.84
7.3.10.0070.00316.61
7.3.00.0100.00316.67
7.2.330.0100.01016.77
7.2.320.0030.01416.77
7.2.310.0120.00616.69
7.2.300.0030.01316.46
7.2.290.0000.01716.64
7.2.130.0030.00617.08
7.2.120.0070.00717.07
7.2.110.0040.00817.02
7.2.100.0070.00316.92
7.2.90.0000.01217.00
7.2.80.0090.00317.08
7.2.70.0080.00816.83
7.2.60.0020.01016.81
7.2.50.0030.00617.02
7.2.40.0090.00616.87
7.2.30.0090.00617.04
7.2.20.0030.01117.02
7.2.10.0030.00717.04
7.2.00.0100.00017.10
7.1.250.0060.00315.85
7.1.200.0040.01115.93
7.1.70.0040.00416.96
7.1.60.0070.01719.30
7.1.50.0030.01316.91
7.1.00.0030.04722.28
7.0.200.0000.01016.47
7.0.140.0030.07021.95
7.0.120.0000.07722.15
7.0.60.0030.08720.03
7.0.50.0000.04317.93
7.0.40.0070.08320.09
7.0.30.0300.04020.02
7.0.20.0200.08320.03
7.0.10.0130.08020.10
7.0.00.0130.08320.10
5.6.280.0030.07320.88
5.6.210.0070.08320.74
5.6.200.0100.03318.15
5.6.190.0070.05720.48
5.6.180.4130.03720.64
5.6.170.0270.06320.44
5.6.160.0070.06720.41
5.6.150.0000.08718.21
5.6.140.0030.05718.12
5.6.130.0170.03318.04
5.6.120.0100.04720.97
5.6.110.0030.04020.98
5.6.100.0070.05721.12
5.6.90.0100.07021.02
5.6.80.0030.07720.43
5.6.70.4100.04020.38
5.5.350.0230.08720.34
5.5.340.0100.07717.93
5.5.330.0030.04320.15
5.5.320.4270.04720.17
5.5.310.0200.04320.26
5.5.300.0170.03017.96
5.5.290.0070.08017.88
5.5.280.0130.07720.74
5.5.270.0070.04020.96
5.5.260.0130.08320.72
5.5.250.0030.04020.57
5.5.240.0200.07320.03
5.4.450.0070.08319.13
5.4.440.0070.04719.50
5.4.430.0200.07019.10
5.4.420.0070.07719.40
5.4.410.0070.04319.35
5.4.400.0070.05318.81
5.4.390.0070.04718.79
5.4.380.0030.04018.79
5.4.370.0100.07719.15
5.4.360.0030.08019.14
5.4.350.0030.07719.20
5.4.340.0000.06719.09
5.4.320.0100.07019.21
5.4.310.0070.05318.78
5.4.300.0000.04319.14
5.4.290.0000.04319.08
5.4.280.0070.08018.80
5.4.270.0070.04318.82
5.4.260.0070.04019.08
5.4.250.0230.05719.17
5.4.240.0070.04319.17
5.4.230.0000.04319.17
5.4.220.0030.04019.15
5.4.210.0100.03319.22
5.4.200.0030.04019.08
5.4.190.0070.07319.07
5.4.180.0100.06019.17
5.4.170.0100.03318.91
5.4.160.0100.03318.77
5.4.150.0070.03719.16
5.4.140.0070.03716.24
5.4.130.0030.04016.23
5.4.120.0100.03716.21
5.4.110.0000.04016.23
5.4.100.0130.06016.33
5.4.90.0100.05016.23
5.4.80.0070.04016.22
5.4.70.0000.04716.29
5.4.60.0030.03316.21
5.4.50.0030.03716.28
5.4.40.0070.07716.27
5.4.30.0030.05316.24
5.4.20.0030.05016.36
5.4.10.0000.05316.23
5.4.00.0070.07015.88
5.3.290.0070.04014.58
5.3.280.0030.05014.56
5.3.270.0030.08314.52
5.3.260.0100.07314.62
5.3.250.0070.03714.55
5.3.240.0070.03314.55
5.3.230.0100.03714.52
5.3.220.0100.07314.50
5.3.210.0170.05014.54
5.3.200.0100.03014.66
5.3.190.0130.06714.54
5.3.180.0070.06314.48
5.3.170.0030.04314.51
5.3.160.0070.03314.34
5.3.150.0200.06014.50
5.3.140.0030.07314.47
5.3.130.0000.04714.52
5.3.120.0070.06014.36
5.3.110.0030.04314.44
5.3.100.0070.04013.93
5.3.90.0030.03714.11
5.3.80.0000.04313.94
5.3.70.0000.03714.03
5.3.60.0070.07013.93
5.3.50.0100.03713.88
5.3.40.0030.06313.73
5.3.30.0030.06013.91
5.3.20.0130.06713.52
5.3.10.0030.03713.47
5.3.00.0070.04013.46
5.2.170.0030.03011.23
5.2.160.0070.04011.11
5.2.150.0030.05010.96
5.2.140.0000.04011.11
5.2.130.0000.04011.09
5.2.120.0030.04311.04
5.2.110.0030.02711.18
5.2.100.0070.05710.92
5.2.90.0030.03711.00
5.2.80.0070.06711.06
5.2.70.0030.04711.03
5.2.60.0030.04310.90
5.2.50.0070.06010.89
5.2.40.0030.04710.99
5.2.30.0030.04310.98
5.2.20.0100.05010.81
5.2.10.0100.04310.90
5.2.00.0000.05010.71
5.1.60.0030.05010.06
5.1.50.0070.03310.00
5.1.40.0000.04010.02
5.1.30.0070.05310.41
5.1.20.0030.06010.25
5.1.10.0070.03710.05
5.1.00.0100.03310.14
5.0.50.0070.0178.59
5.0.40.0000.0208.42
5.0.30.0000.0678.28
5.0.20.0070.0408.35
5.0.10.0000.0308.18
5.0.00.0000.0378.11
4.4.90.0070.0307.52
4.4.80.0000.0177.52
4.4.70.0000.0337.52
4.4.60.0000.0237.52
4.4.50.0030.0237.52
4.4.40.0100.0477.52
4.4.30.0030.0177.52
4.4.20.0000.0377.52
4.4.10.0070.0207.52
4.4.00.0030.0237.52
4.3.110.0030.0377.52
4.3.100.0030.0207.52
4.3.90.0070.0207.52
4.3.80.0000.0237.52
4.3.70.0000.0177.52
4.3.60.0000.0177.52
4.3.50.0000.0237.52
4.3.40.0000.0437.52
4.3.30.0000.0207.52
4.3.20.0000.0377.52
4.3.10.0000.0307.52
4.3.00.0000.0307.52

preferences:
39.7 ms | 400 KiB | 5 Q