3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <html> <head> <script type='text/javascript' src='/wp-includes/js/jquery/jquery.js?ver=1.8.3'></script> <script type='text/javascript' src='https://www.example.com/leave-this-alone'></script> <script language="JavaScript"> window.moveTo(0,0); window.resizeTo(screen.width,screen.height); </script> </head> </html> HTML; $workingUrl = 'https://www.example.com'; $dom = new DOMDocument; $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($dom); foreach ($xpath->query("//script[@src and not(starts-with(@src,'http'))]") as $node) { $node->setAttribute('src', $workingUrl); } echo $dom->saveHTML();
Output for git.master, git.master_jit, rfc.property-hooks
<html> <head> <script type="text/javascript" src="https://www.example.com"></script> <script type="text/javascript" src="https://www.example.com/leave-this-alone"></script> <script language="JavaScript"> window.moveTo(0,0); window.resizeTo(screen.width,screen.height); </script> </head> </html>

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:
54.82 ms | 401 KiB | 8 Q