3v4l.org

run code in 300+ PHP versions simultaneously
<?php $video_url = 'http://google.com'; $needles = array('http://', 'https://'); // Normalise the URLs foreach ($needles as $needle) { if ( strpos($video_url, $needle) !== 0 ) { $video_url = 'http://' . $video_url; break 2; } } echo $video_url;
Output for 5.4.0 - 5.4.34
Fatal error: Cannot break/continue 2 levels in /in/Bb3mf on line 12
Process exited with code 255.

preferences:
171.73 ms | 1395 KiB | 41 Q