3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $pattern = '(src|href)\=(\\'|")([^\\'"]+)(\\'|")'; $source = <<<SRC <a href="http://www.sape.ru">some text</a> <img src='logo.jpg' alt=''></a> SRC; $callback = function($matches) { var_dump($matches); return ''; }; preg_replace_callback($pattern, $callback, $source);
Output for 5.3.0 - 5.4.16
Parse error: syntax error, unexpected ']' in /in/8hECJ on line 3
Process exited with code 255.