3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = 'id=1 username=foobar comment=This is a sample comment'; $result = preg_replace_callback( '/\b(comment=)(.+)$/ms', function (array $matches) { return $matches[1] . preg_replace("/[\r\n]+/", " ", $matches[2])'; }, $data ); var_dump($result);
Output for 5.4.0 - 5.4.19
Parse error: syntax error, unexpected '';' (T_ENCAPSED_AND_WHITESPACE) in /in/M9SEQ on line 15
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE in /in/M9SEQ on line 15
Process exited with code 255.