3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('HAZELFENCES_WEBSITE', 'https://test.com'); $text = '[youtube]https://www.youtube.com/watch?v=xHLE2LTAItw&amp;t=53s[/youtube]'; $text .= '[youtube]https://www.youtube.com/watch?v=xHLE2LTAItw[/youtube]'; if (preg_match_all("/\[youtube\]((\s|.)+?)\[\/youtube\]/i", $text, $matches)) { $allMatches = count($matches[0]); if (is_array($matches[0]) && $allMatches > 0) { for ($i = 0; $i < $allMatches; $i++) { $text = str_replace("watch?v=", "embed/", $text); if (strpos($matches[0][$i], "&amp;t=") !== false) { $text = str_replace("&amp;t=", "?start=", $text); $text = preg_replace("#s\[\/youtube\]#i", "&enablejsapi=1&origin=". HAZELFENCES_WEBSITE ."[/youtube]", $text); } else { $text = preg_replace("#\[\/youtube\]#i", "?enablejsapi=1&origin=". HAZELFENCES_WEBSITE ."[/youtube]", $text); } } $text = preg_replace("/\[youtube\]((\s|.)+?)\[\/youtube\]/i", "<iframe width=\"640\" height=\"510\" src=\"\\1\" loading=\"lazy\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>", $text); } } echo $text; ?>
Output for git.master, git.master_jit, rfc.property-hooks
<iframe width="640" height="510" src="https://www.youtube.com/embed/xHLE2LTAItw?start=53&enablejsapi=1&origin=https://test.com?enablejsapi=1&origin=https://test.com" loading="lazy" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><iframe width="640" height="510" src="https://www.youtube.com/embed/xHLE2LTAItw?enablejsapi=1&origin=https://test.com" loading="lazy" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
77.13 ms | 407 KiB | 5 Q