3v4l.org

run code in 300+ PHP versions simultaneously
<?php function matchYoutubeUrl(url){ var p = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/; return (url.match(p)) ? RegExp.$1 : false ; } var_dump(matchYoutubeUrl("https://www.youtube.com/watch?v=R4h7PgrCPWQ"));
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected ')', expecting '&' or variable (T_VARIABLE) in /in/n92gY on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected ')', expecting '&' or T_VARIABLE in /in/n92gY on line 3
Process exited with code 255.

preferences:
170.97 ms | 1395 KiB | 67 Q