3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = '/product/random?category_id=1'; $pattern = '/regex/'; var_dump(preg_match($str, $pattern, $matches = []));
based on 3DtbH
Output for 7.0.0 - 7.2.0
Notice: Only variables should be passed by reference in /in/q7G3M on line 4 Warning: preg_match(): Unknown modifier 'r' in /in/q7G3M on line 4 bool(false)
Output for 5.4.2 - 5.6.28
Strict Standards: Only variables should be passed by reference in /in/q7G3M on line 4 Warning: preg_match(): Unknown modifier 'r' in /in/q7G3M on line 4 bool(false)
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/q7G3M on line 4
Process exited with code 255.