3v4l.org

run code in 300+ PHP versions simultaneously
<?php function is_regex($string) { return false !== @preg_match($string, 'anything'); } foreach (array('/foobar/', '/foobar/i', '`test{1,3}`', '/foo', '/foo(bar/') as $candidate) { var_dump(array($candidate, is_regex($candidate)); }
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.24
Parse error: syntax error, unexpected ';' in /in/qbut5 on line 8
Process exited with code 255.

preferences:
169.04 ms | 1395 KiB | 61 Q