3v4l.org

run code in 300+ PHP versions simultaneously
<?php $meta = '<meta content="21;URL=\'http://example.com/\'" http-equiv="refresh" /> <meta content="21;URL=\'http://example.com/?PageSpeed=noscript\'" http-equiv="refresh" />'; $dom = new DOMDocument; $dom->loadHTML($meta); $noPageScripts = []; foreach ($dom->getElementsByTagName('meta') as $tag) { $content = $tag->getAttribute('content'); // Match the URL preg_match('/URL=["\']?([^"\'>]+)["\']?/i',$content,$matches); if($tag->getAttribute('http-equiv') && isset($matches[1]) && stripos($matches[1],'?PageSpeed=noscript') === false) { $noPageScripts[] = [ 'originalTag' => $dom->saveHTML($tag), 'url' => $matches[1] ]; } } var_dump($noPageScripts);
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { [0]=> array(2) { ["originalTag"]=> string(66) "<meta content="21;URL='http://example.com/'" http-equiv="refresh">" ["url"]=> string(19) "http://example.com/" } }

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:
131.09 ms | 406 KiB | 5 Q