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 - 7.1.0
Warning: preg_match(): No ending delimiter '^' found in /in/NBrYJ on line 2 Array ( [0] => dsgfcdfsg- [1] => dsgfcdfsg- )
Output for 4.3.11 - 5.1.6
Warning: preg_match(): No ending delimiter '^' found in /in/NBrYJ on line 2 Array ( ) Array ( [0] => dsgfcdfsg- [1] => dsgfcdfsg- )
Output for 4.3.0 - 4.3.10
Warning: No ending delimiter '^' found in /in/NBrYJ on line 2 Array ( ) Array ( [0] => dsgfcdfsg- [1] => dsgfcdfsg- )