3v4l.org

run code in 500+ PHP versions simultaneously
<?php $html = <<<HTML <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content=""> <meta name="description" content=""> <meta name="author" content=""> <title></title> <link rel="apple-touch-icon" href=""> <link rel="shortcut icon" href=""> <!-- Stylesheets --> <link rel="stylesheet" href=""> <!-- Some Stylesheets --> <link rel="stylesheet" href=""> <!-- Some Stylesheets --> <link rel="stylesheet" href=""> <!-- Some Stylesheets --> <!-- Scripts --> <script src=""></script> </head> <body class=""> <nav class="nav1" role="navigation"> <!-- Some HTML --> </nav> <div class="menubar1"> <!-- Some HTML --> </div> <div class="menubar2"> <div> <div> <ul> <li></li> </ul> </div> </div> <!-- Some HTML --> </div> <!-- ========================================================= --> <!-- ========================================================= --> <!-- PAGE CONTENTS --> <!-- ========================================================= --> <!-- ========================================================= --> <!-- Footer --> <footer class="site-footer"> <!-- Some HTML --> </footer> <script src=""></script> <!-- Some Script Tags --> <script src=""></script> <!-- Some Script Tags --> <script src=""></script> <!-- Some Script Tags --> <script src=""></script> <!-- Some Script Tags --> <!-- Page --> <!-- Google Analytics --> <script> /* Some Scripts */ </script> </body> </html> HTML; libxml_use_internal_errors(true); $doc = new \DOMDocument(); $doc->loadHTML($html); $menubar2_inner_div_count = (new \DOMXPath($doc))->query('//div[@class="menubar2"]//div')->length; $html = preg_replace('/^.*?<div class="menubar2">' . str_repeat('.*?<\/div>', $menubar2_inner_div_count + 1) . '/s', '<!-- Header -->' . PHP_EOL . '<?php include_once "include/header.php" ?>', $html); $html = preg_replace('/<footer class="site-footer">.*?<\/html>/s', '<?php include_once "include/footer.php" ?>', $html); $html = preg_replace('/^ {8}/m', '', $html); echo $html;
Output for git.master, git.master_jit, rfc.property-hooks
<!-- Header --> <?php include_once "include/header.php" ?> <!-- ========================================================= --> <!-- ========================================================= --> <!-- PAGE CONTENTS --> <!-- ========================================================= --> <!-- ========================================================= --> <!-- Footer --> <?php include_once "include/footer.php" ?>

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:
41.51 ms | 1578 KiB | 4 Q