3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $pattern = '~\{(.*?)\}~'; $string = '{3}+{2}-{1}'; preg_match_all($pattern, $string, $matches); print_r($matches[1]); // 1234
based on 6grGG
Output for 4.3.0 - 5.0.5, 5.1.1 - 7.2.0
Array ( [0] => 3 [1] => 2 [2] => 1 )
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/5FdN1 on line 5
Process exited with code 255.