3v4l.org

run code in 300+ PHP versions simultaneously
<?php <?php $re = '/^([^{]+)(?:\{(.+)\})?$/'; $str = 'type{test}'; preg_match($re, $str, $matches); // Print the entire match result var_dump($matches);
Output for 7.0.0 - 7.0.31, 7.1.0 - 7.1.21, 7.2.0 - 7.2.9
Parse error: syntax error, unexpected '<', expecting end of file in /in/Ynn4P on line 3
Process exited with code 255.

preferences:
188 ms | 1395 KiB | 71 Q