3v4l.org

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