3v4l.org

run code in 300+ PHP versions simultaneously
<?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.5.0 - 5.5.6
Parse error: syntax error, unexpected '^' in /in/RQlIe on line 2
Process exited with code 255.
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.22
Parse error: syntax error, unexpected '^', expecting ')' in /in/RQlIe on line 2
Process exited with code 255.

preferences:
187.52 ms | 1395 KiB | 65 Q