3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php preg_match("(\a-zA-Z0-9_)?/", "dsgfcdfsg\-sf",$matches); print_r($matches); echo "\n"; preg_match("/(\w*\-)/", "dsgfcdfsg-sf",$matches); print_r($matches);
Output for 5.2.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: preg_match(): Unknown modifier '?' in /in/kCqS1 on line 2 Array ( [0] => dsgfcdfsg- [1] => dsgfcdfsg- )
Output for hhvm-3.10.0 - 3.12.0
Warning: Unknown modifier '?': [(\a-zA-Z0-9_)?/] in /in/kCqS1 on line 2 Array ( [0] => dsgfcdfsg- [1] => dsgfcdfsg- )
Output for 4.3.11 - 5.1.6
Warning: preg_match(): Unknown modifier '?' in /in/kCqS1 on line 2 Array ( ) Array ( [0] => dsgfcdfsg- [1] => dsgfcdfsg- )
Output for 4.3.0 - 4.3.10
Warning: Unknown modifier '?' in /in/kCqS1 on line 2 Array ( ) Array ( [0] => dsgfcdfsg- [1] => dsgfcdfsg- )