3v4l.org

run code in 300+ PHP versions simultaneously
<?php $video = "https://youtu.be/9g30pPikveg"; $pattern = 'https?://(?:www\.)?youtu\.be/\'; $replacement = 'http://www.youtube.com/embed/'; $final = preg_replace($pattern, $replacement, $video); echo $final;
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.15
Parse error: syntax error, unexpected 'http' (T_STRING) in /in/cKc3E on line 4
Process exited with code 255.

preferences:
176.07 ms | 1395 KiB | 22 Q