3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = "Foo *Bar\* asdf* Baz"; var_dump(preg_replace_callback('{\*([\\\*]*[^\*]+)\*?}', function($matches) { return "<b>{$matches[1]}</b>"; }, $str));
Output for 5.3.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(31) "Foo <b>Bar\</b> asdf<b> Baz</b>"
Output for 5.2.15 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/TPdc2 on line 5
Process exited with code 255.