3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $text = "Oele\nBoele\n\nDus Want\n\nBlaaaaaaaaaaaa"; $text = '<p>' . $text . '</p>'; $text = preg_replace('#\n\n#', '</p><p>', $text); $text = preg_replace('#\n#', '<br />', $text); $text = preg_replace('#><#', ">\n<", $text); echo $text;
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
<p>Oele<br />Boele</p> <p>Dus Want</p> <p>Blaaaaaaaaaaaa</p>
Output for hhvm-3.10.0

Process exited with code 153.