3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "Line 1\nLine 2\n"; echo nl2br($text);

preferences:
25.61 ms | 402 KiB | 5 Q