3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function explodeYoutubeId($newstext, $divopt){ $search_text = array( "'^(http[s]*://www.youtube.com/watch\?[.]*v='", ); $replace_text = array( "", ); $newtext = preg_replace($search_text,$replace_text,$newstext); $newtext = '<div '.$divopt.'><p>'.$newtext.'</p></div>'; return $newtext; } echo explodeYoutubeId('https://www.youtube.com/watch?feature=player_embedded&v=M7lc1UVf-VE#!'); ?>
Output for 7.1.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function explodeYoutubeId(), 1 passed in /in/N8gQF on line 15 and exactly 2 expected in /in/N8gQF:2 Stack trace: #0 /in/N8gQF(15): explodeYoutubeId('https://www.you...') #1 {main} thrown in /in/N8gQF on line 2
Process exited with code 255.
Output for 5.5.0 - 5.6.28, 7.0.0 - 7.0.14
Warning: Missing argument 2 for explodeYoutubeId(), called in /in/N8gQF on line 15 and defined in /in/N8gQF on line 2 Warning: preg_replace(): Compilation failed: missing ) at offset 42 in /in/N8gQF on line 9 Notice: Undefined variable: divopt in /in/N8gQF on line 10 <div ><p></p></div>
Output for hhvm-3.10.0 - 3.12.0
Warning: explodeYoutubeId() expects exactly 2 parameters, 1 given in /in/N8gQF on line 5 Warning: Compilation failed: missing ) at offset 42 in /in/N8gQF on line 9 Notice: Undefined variable: divopt in /in/N8gQF on line 10 <div ><p></p></div>
Output for 5.2.5 - 5.4.45
Warning: Missing argument 2 for explodeYoutubeId(), called in /in/N8gQF on line 15 and defined in /in/N8gQF on line 2 Warning: preg_replace(): Compilation failed: missing ) at offset 42 in /in/N8gQF on line 9 <div ><p></p></div>
Output for 5.2.3 - 5.2.4
Warning: Missing argument 2 for explodeYoutubeId(), called in /in/N8gQF on line 15 and defined in /in/N8gQF on line 2 Warning: preg_replace(): Compilation failed: missing ) at offset 42 in /in/N8gQF on line 9 <div ><p>https://www.youtube.com/watch?feature=player_embedded&v=M7lc1UVf-VE#!</p></div>
Output for 5.1.0 - 5.2.2
<br /> <b>Warning</b>: Missing argument 2 for explodeYoutubeId(), called in /in/N8gQF on line 15 and defined in <b>/in/N8gQF</b> on line <b>2</b><br /> <br /> <b>Warning</b>: preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Compilation failed: missing ) at offset 42 in <b>/in/N8gQF</b> on line <b>9</b><br /> <div ><p>https://www.youtube.com/watch?feature=player_embedded&v=M7lc1UVf-VE#!</p></div>
Output for 5.0.0 - 5.0.5
<br /> <b>Warning</b>: Missing argument 2 for explodeYoutubeId() in <b>/in/N8gQF</b> on line <b>2</b><br /> <br /> <b>Warning</b>: preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Compilation failed: missing ) at offset 42 in <b>/in/N8gQF</b> on line <b>9</b><br /> <div ><p>https://www.youtube.com/watch?feature=player_embedded&v=M7lc1UVf-VE#!</p></div>
Output for 4.4.3 - 4.4.9
<br /> <b>Warning</b>: Missing argument 2 for explodeyoutubeid() in <b>/in/N8gQF</b> on line <b>2</b><br /> <br /> <b>Warning</b>: preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Compilation failed: missing ) at offset 42 in <b>/in/N8gQF</b> on line <b>9</b><br /> <div ><p>https://www.youtube.com/watch?feature=player_embedded&v=M7lc1UVf-VE#!</p></div>
Output for 4.3.11 - 4.4.2
<br /> <b>Warning</b>: Missing argument 2 for explodeyoutubeid() in <b>/in/N8gQF</b> on line <b>2</b><br /> <br /> <b>Warning</b>: preg_replace(): Compilation failed: missing ) at offset 42 in <b>/in/N8gQF</b> on line <b>9</b><br /> <div ><p>https://www.youtube.com/watch?feature=player_embedded&v=M7lc1UVf-VE#!</p></div>
Output for 4.3.0 - 4.3.10
<br /> <b>Warning</b>: Missing argument 2 for explodeyoutubeid() in <b>/in/N8gQF</b> on line <b>2</b><br /> <br /> <b>Warning</b>: Compilation failed: missing ) at offset 42 in <b>/in/N8gQF</b> on line <b>9</b><br /> <div ><p>https://www.youtube.com/watch?feature=player_embedded&v=M7lc1UVf-VE#!</p></div>