3v4l.org

run code in 300+ PHP versions simultaneously
<?php $frequentlyWritten = array( 'option_name: akismet_spam_count', 'option_name:request_counter', '-option_name:request_counter', "option_name:'request_counter'", 'option_name:"request_counter", ); // https://regex101.com/r/wT6zG3/2 (query language) $re = "/(-)?(?:(\\S+):\\s*)?(?:'((?:[^'\\\\]|\\\\.)*)'|\"((?:[^\"\\\\]|\\\\.)*)\"|(\\S+))/"; foreach ($frequentlyWritten as $rule) { preg_match_all($re, $rule, $matches); print_r($matches); }
Output for 7.0.0 - 7.0.2
Parse error: syntax error, unexpected '?' in /in/8gH3C on line 12
Process exited with code 255.
Output for 5.5.24 - 5.5.31, 5.6.8 - 5.6.17
Parse error: syntax error, unexpected '(', expecting ')' in /in/8gH3C on line 12
Process exited with code 255.

preferences:
170.29 ms | 1387 KiB | 28 Q