3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = '<iframe width="560" height="315" src="https://www.youtube.com/embed/W9k0OhJkjQ0" frameborder="0" allowfullscreen></iframe>'; $dom = new \DOMDocument( '1.0', 'UTF-8' ); // muted because malformed HTML cause warnings @$dom->loadXml( "<iframe_content>{$content}</iframe_content>" ); $domIframe = $dom->getElementsByTagName( 'iframe' ); // seems this iframe is not an iframe if ( ! $domIframe->length ) { echo 'No Iframe'; } /** @var \DOMElement $iframeNode */ $iframeNode = $domIframe->item( 0 ); $iframeNode->removeAttribute( 'width' ); $iframeNode->removeAttribute( 'height' ); echo $dom->saveHTML( $iframeNode );
Output for git.master, git.master_jit, rfc.property-hooks
No Iframe Fatal error: Uncaught Error: Call to a member function removeAttribute() on null in /in/MEdVQ:17 Stack trace: #0 {main} thrown in /in/MEdVQ on line 17
Process exited with code 255.

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