3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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( '/(?<!' . $nl . ')' . $nl . '(?!' . $nl . ')/', '', $text);
Output for 4.3.11 - 7.1.0
Warning: preg_replace(): Compilation failed: lookbehind assertion is not fixed length at offset 14 in /in/kJL6T on line 11
Output for 4.3.0 - 4.3.10
Warning: Compilation failed: lookbehind assertion is not fixed length at offset 14 in /in/kJL6T on line 11