3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'Featuring six amazing National Parks: Glacier, Waterton Lakes, Yellowstone, Grand Teton, Arches, and Canyonlands. Your tour begins in Chicago where you will board the Empire Builder bound for the first National Park on your trip, Glacier, where you will explore the famed Going-to-the-Sun Road and enjoy a full-day excursion to Waterton Lakes National Park in Canada (passport required).'; $nl = "(?:\n|\r\n|\r)"; echo preg_replace( '/(?<!\s)' . $nl . '(?!' . $nl . ')/', '', $text);

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.0140.00418.98
8.3.30.0040.01218.89
8.3.20.0090.00018.72
8.3.10.0080.00020.72
8.3.00.0090.00023.28
8.2.170.0140.00722.96
8.2.160.0170.00020.38
8.2.150.0080.00024.18
8.2.140.0050.00524.66
8.2.130.0000.00826.16
8.2.120.0150.00319.48
8.2.110.0060.00322.23
8.2.100.0080.00317.84
8.2.90.0050.00219.22
8.2.80.0030.00517.97
8.2.70.0040.00417.75
8.2.60.0030.00517.80
8.2.50.0000.00818.07
8.2.40.0000.00918.22
8.2.30.0000.00719.79
8.2.20.0000.00817.72
8.2.10.0030.00517.91
8.2.00.0050.00317.79
8.1.270.0050.00323.99
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0050.00522.29
8.1.230.0000.01220.91
8.1.220.0050.00318.77
8.1.210.0040.00418.85
8.1.200.0000.01017.48
8.1.190.0050.00319.32
8.1.180.0000.00818.10
8.1.170.0040.00418.74
8.1.160.0020.00518.81
8.1.150.0070.00018.71
8.1.140.0050.00317.66
8.1.130.0000.00717.90
8.1.120.0040.00417.66
8.1.110.0040.00417.52
8.1.100.0000.00717.57
8.1.90.0040.00417.67
8.1.80.0000.00717.53
8.1.70.0030.00317.55
8.1.60.0000.00817.80
8.1.50.0090.00017.54
8.1.40.0000.00717.72
8.1.30.0000.00717.85
8.1.20.0000.00817.83
8.1.10.0040.00417.65
8.1.00.0000.00817.50
8.0.300.0000.00919.82
8.0.290.0000.00717.16
8.0.280.0030.00318.53
8.0.270.0020.00517.29
8.0.260.0040.00416.98
8.0.250.0000.00717.14
8.0.240.0100.00017.05
8.0.230.0050.00317.07
8.0.220.0030.00316.92
8.0.210.0030.00517.09
8.0.200.0060.00017.17
8.0.190.0000.00816.99
8.0.180.0040.00417.11
8.0.170.0030.00616.91
8.0.160.0030.00517.09
8.0.150.0030.00717.06
8.0.140.0060.00617.01
8.0.130.0030.00313.47
8.0.120.0070.00016.99
8.0.110.0080.00016.92
8.0.100.0040.00416.95
8.0.90.0080.00017.07
8.0.80.0060.00916.99
8.0.70.0050.00317.03
8.0.60.0040.00417.15
8.0.50.0040.00416.97
8.0.30.0140.00817.06
8.0.20.0110.00917.40
8.0.10.0040.00417.07
8.0.00.0150.00617.04
7.4.330.0070.00013.43
7.4.320.0000.00716.69
7.4.300.0030.00316.73
7.4.290.0000.00816.88
7.4.280.0040.00416.85
7.4.270.0070.00016.63
7.4.260.0050.00013.53
7.4.250.0090.00016.66
7.4.240.0080.00016.74
7.4.230.0000.00716.68
7.4.220.0120.00616.77
7.4.210.0080.00816.69
7.4.200.0080.00016.74
7.4.190.0070.00016.64
7.4.160.0090.01216.44
7.4.150.0060.01217.40
7.4.140.0080.01117.86
7.4.130.0050.01616.70
7.4.120.0090.00916.68
7.4.110.0140.00316.60
7.4.100.0030.01316.66
7.4.90.0070.01016.70
7.4.80.0070.01519.37
7.4.70.0060.01316.55
7.4.60.0150.00616.41
7.4.50.0040.00416.79
7.4.40.0070.00522.27
7.4.30.0120.00916.79
7.4.00.0080.00815.10
7.3.330.0000.00513.32
7.3.320.0030.00313.17
7.3.310.0030.00316.27
7.3.300.0060.00016.31
7.3.290.0040.01116.35
7.3.280.0080.00716.43
7.3.270.0120.00617.40
7.3.260.0050.01218.24
7.3.250.0070.01016.63
7.3.240.0000.01716.40
7.3.230.0070.01016.41
7.3.210.0140.00316.44
7.3.200.0110.00819.39
7.3.190.0130.00716.68
7.3.180.0120.00916.75
7.3.170.0070.01116.54
7.3.160.0030.01216.45
7.3.120.0080.01015.02
7.3.110.0090.00915.07
7.3.100.0080.00914.89
7.3.90.0070.00614.97
7.3.80.0070.00714.89
7.3.70.0070.00714.96
7.3.60.0070.00314.81
7.3.50.0020.01114.89
7.3.40.0040.00814.98
7.3.30.0060.00614.96
7.3.20.0050.01016.90
7.3.10.0060.00516.81
7.3.00.0030.01216.73
7.2.330.0100.00716.73
7.2.320.0100.00616.72
7.2.310.0080.01616.82
7.2.300.0070.01016.77
7.2.290.0070.01016.80
7.2.250.0100.00815.12
7.2.240.0110.00715.13
7.2.230.0080.00815.27
7.2.220.0030.01114.93
7.2.210.0050.01015.20
7.2.200.0100.00315.23
7.2.190.0020.01115.11
7.2.180.0080.00714.91
7.2.170.0060.00315.12
7.2.60.0160.00016.78
7.2.00.0030.01419.50
7.1.330.0070.00716.13
7.1.320.0090.00416.08
7.1.310.0060.00715.87
7.1.300.0080.00415.80
7.1.290.0060.01015.89
7.1.280.0050.00615.98
7.1.270.0070.00715.91
7.1.260.0030.01016.02
7.1.200.0060.00615.66
7.1.100.0040.00818.34
7.1.70.0030.00717.33
7.1.60.0130.01019.40
7.1.50.0060.00917.11
7.1.00.0000.07322.33
7.0.200.0040.00416.94
7.0.140.0130.06322.00
7.0.60.0070.08320.02
7.0.50.0070.06717.82
7.0.40.0100.08020.26
7.0.30.0170.05720.13
7.0.20.0170.05020.11
7.0.10.0070.05720.19
7.0.00.0100.08020.02
5.6.280.0100.06320.91
5.6.210.0070.03720.47
5.6.200.0000.06018.18
5.6.190.0130.08020.67
5.6.180.0500.07320.57
5.6.170.0170.04720.40
5.6.160.0100.05320.54
5.6.150.0200.07018.21
5.6.140.0070.08318.25
5.6.130.0000.05318.14
5.6.120.0070.08721.03
5.6.110.0000.04721.13
5.6.100.0000.04721.00
5.6.90.0130.07321.07
5.6.80.0130.07720.52
5.5.350.0300.03020.35
5.5.340.0070.04717.97
5.5.330.0030.04720.37
5.5.320.0100.08320.32
5.5.310.0230.03720.27
5.5.300.0070.03718.00
5.5.290.0100.07718.00
5.5.280.0070.08720.97
5.5.270.0030.07020.71
5.5.260.0000.09320.89
5.5.250.0030.07020.57
5.5.240.0030.05720.22
5.4.450.0070.04719.41
5.4.440.0070.04319.50
5.4.430.0070.04319.11
5.4.420.0100.04319.39
5.4.410.0070.08018.98
5.4.400.0100.03319.02
5.4.390.0070.08018.79
5.4.380.0070.07019.18
5.4.370.0130.03719.14
5.4.360.0070.08318.79
5.4.350.0070.05718.91
5.4.340.0100.06018.79
5.4.320.0030.08319.08
5.4.310.0070.05319.16
5.4.300.0000.04319.17
5.4.290.0100.06718.91
5.4.280.0070.05018.91
5.4.270.0230.03019.08
5.4.260.0030.06718.78
5.4.250.0000.04018.91
5.4.240.0170.06719.14
5.4.230.0000.05019.07
5.4.220.0130.06319.17
5.4.210.0030.04018.86
5.4.200.0000.04019.17
5.4.190.0070.04019.16
5.4.180.0030.04319.07
5.4.170.0070.04718.80
5.4.160.0030.05319.05
5.4.150.0030.07718.77
5.4.140.0070.06016.37
5.4.130.0100.07016.26
5.4.120.0070.05716.25
5.4.110.0100.03316.37
5.4.100.0070.07716.39
5.4.90.0000.04016.23
5.4.80.0030.07716.37
5.4.70.0030.04316.64
5.4.60.0030.04016.28
5.4.50.0070.06316.34
5.4.40.0070.03316.28
5.4.30.0070.04716.21
5.4.20.0030.06316.30
5.4.10.0130.04316.11
5.4.00.0100.06015.70
5.3.290.0000.05014.75
5.3.280.0130.07014.54
5.3.270.0100.07314.48
5.3.260.0030.08314.54
5.3.250.0030.06714.42
5.3.240.0130.05714.54
5.3.230.0070.07314.52
5.3.220.0070.06714.49
5.3.210.0100.04014.52
5.3.200.0030.03714.53
5.3.190.0030.04014.49
5.3.180.0130.07014.44
5.3.170.0030.07714.49
5.3.160.0070.06314.50
5.3.150.0000.05314.35
5.3.140.0030.06314.52
5.3.130.0030.05314.48
5.3.120.0070.06714.52
5.3.110.0030.05014.44
5.3.100.0070.03714.00
5.3.90.0000.04013.96
5.3.80.0030.03713.93
5.3.70.0070.03313.94
5.3.60.0000.04013.95
5.3.50.0130.04014.04
5.3.40.0000.04013.90
5.3.30.0000.03713.85
5.3.20.0070.03313.71
5.3.10.0000.03713.60
5.3.00.0070.03313.60
5.2.170.0000.03310.96
5.2.160.0070.02711.13
5.2.150.0030.03011.11
5.2.140.0000.03711.29
5.2.130.0070.02311.05
5.2.120.0000.03011.09
5.2.110.0070.03311.08
5.2.100.0000.03311.18
5.2.90.0030.03011.04
5.2.80.0030.02711.24
5.2.70.0000.03311.02
5.2.60.0030.02710.87
5.2.50.0000.03010.91
5.2.40.0030.02710.88
5.2.30.0030.02710.95
5.2.20.0000.03010.89
5.2.10.0000.03010.85
5.2.00.0000.03010.75
5.1.60.0030.0239.98
5.1.50.0070.0209.99
5.1.40.0030.0239.88
5.1.30.0070.02010.35
5.1.20.0030.02310.34
5.1.10.0030.02310.05
5.1.00.0000.02710.06
5.0.50.0070.0138.81
5.0.40.0030.0178.81
5.0.30.0000.0308.81
5.0.20.0030.0178.81
5.0.10.0000.0208.81
5.0.00.0000.0308.81
4.4.90.0000.0178.81
4.4.80.0000.0138.81
4.4.70.0000.0178.81
4.4.60.0000.0178.81
4.4.50.0030.0138.81
4.4.40.0000.0278.81
4.4.30.0030.0138.81
4.4.20.0000.0178.81
4.4.10.0000.0178.81
4.4.00.0000.0238.81
4.3.110.0030.0178.81
4.3.100.0000.0138.81
4.3.90.0000.0178.81
4.3.80.0000.0238.81
4.3.70.0000.0138.81
4.3.60.0030.0138.81
4.3.50.0070.0108.81
4.3.40.0000.0238.81
4.3.30.0000.0138.81
4.3.20.0000.0138.81
4.3.10.0000.0178.81
4.3.00.0000.0138.81

preferences:
42.37 ms | 400 KiB | 5 Q