3v4l.org

run code in 500+ PHP versions simultaneously
<?php $html = '<meta name="generator" content="WordPress 5.9.3"> <meta name="generator" content="Site Kit by Google 1.73.0"> '; $doc = new DOMDocument(); $doc->loadHTML($html); $metas = $doc->getElementsByTagName('meta'); foreach($metas as $meta){ if($meta->getAttribute('name') == 'generator'){ echo $meta->getAttribute('content') . PHP_EOL; } }
Output for 5.3.29, 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
WordPress 5.9.3 Site Kit by Google 1.73.0

preferences:
109.6 ms | 1246 KiB | 4 Q