3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $re = "/(?<=^\\S|\\s\\S|\\s)[RD]/g"; $str = "-D-K4_NNNN_M116_R1_001.gz _D-K4_NNNN_M56_R1_001.gz R-K4_NNNN_KQ9_R1_001.gz D-K4_NNNN_M987_R1_001.gz _R-K4_NNNN_M987_R1_001.gz"; preg_match_all($re, $str, $matches); echo '<pre>'; print_r($matches); echo '</pre>';
Output for 5.3.21 - 5.6.38, 7.0.0 - 7.2.11
Warning: preg_match_all(): Unknown modifier 'g' in /in/hX1Un on line 6 <pre></pre>
Output for hhvm-3.22.0
Warning: Unknown modifier 'g': [/(?<=^\S|\s\S|\s)[RD]/g] in /in/hX1Un on line -1 <pre></pre>
Output for hhvm-3.10.1 - 3.21.3
Warning: Unknown modifier 'g': [/(?<=^\S|\s\S|\s)[RD]/g] in /in/hX1Un on line 6 <pre></pre>