3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo nl2br("Hello \nmy\rfriend\n\r", true) . PHP_EOL; echo nl2br("Hello \nmy\rfriend\n\r", false);
based on pStkh
Output for 5.3.0 - 7.2.0
Hello <br /> my<br /> friend<br /> Hello <br> my<br> friend<br>
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.2.17
Warning: Wrong parameter count for nl2br() in /in/8tngq on line 2 Warning: Wrong parameter count for nl2br() in /in/8tngq on line 3
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Warning: Wrong parameter count for nl2br() in /in/8tngq on line 2 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8tngq on line 2 PHP_EOL Warning: Wrong parameter count for nl2br() in /in/8tngq on line 3