3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $code = "<p>Test...test...test...</p> [gallery-1]"; preg_match_all("/\[gallery-(\d+)\]/", $code, $matches); $galleries = array(); foreach ($matches[1] as $id) { $galleries[$id] = // Somehow load a gallery basing on id; } foreach ($galleries as $id => $sub) { $code = str_ireplace("[gallery-" . $id . "]", $sub; } echo $code;
Output for 5.3.0 - 5.4.22
Parse error: syntax error, unexpected '}' in /in/MuMl7 on line 11
Process exited with code 255.