3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'Hello world [something here]{optional}{optional}{optional}{n possibilities of this}'; var_export(preg_split('/ *\[|\]|(?=\{)/', $str, 0, PREG_SPLIT_NO_EMPTY));

preferences:
25.64 ms | 405 KiB | 5 Q