3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $text = "[spoiler]Test\ntesting\n\nss\n[/spoiler]."; $text = preg_replace_callback("(\[spoiler\](.*?)\[\/spoiler\])is", function($match){ $lines = explode("\n", str_rot13($match[1])); foreach ($lines as &$line) { if (!empty($line) $line = "[spoiler]".$line."[/spoiler]"; } unset($line); $output = implode("\n",$lines); return $output; }, $text ); echo $text; ?>
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected '$line' (T_VARIABLE) in /in/Uh0Ch on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE in /in/Uh0Ch on line 9
Process exited with code 255.