3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = <<<STR 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). STR; echo preg_replace('/(?<!\n)\R(?!\R)/u', ' ', $string);
Output for 4.4.6 - 4.4.9, 5.2.2 - 5.6.21, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
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).
Output for 4.3.0 - 4.4.5, 5.0.0 - 5.2.1
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 oad and enjoy a full-day excursion to Waterton Lakes National Park in Canada (passport required).