3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex = '[foo|[b]ar]'; preg_match($regex, 'fobar', $match); var_dump($match);

preferences:
45.95 ms | 402 KiB | 5 Q