3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $url = "//youtube.com"; $url = preg_replace("|([^\/]*)\/\/|i",'https://',$url); echo $url;
based on 7bUvj
Output for 4.3.0 - 7.1.0
https://youtube.com