3v4l.org

run code in 500+ PHP versions simultaneously
<?php $html = '<drupal-render-placeholder callback="poll.post_render_cache:renderViewForm" arguments="id=1&view_mode=np8_sidebar" token="e450a32c"></drupal-render-placeholder>'; $document = <<<EOD <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head> <body>!html</body> </html> EOD; // PHP's \DOMDocument serialization adds extra whitespace when the markup // of the wrapping document contains newlines, so ensure we remove all // newlines before injecting the actual HTML body to be processed. $document = strtr($document, array("\n" => '', '!html' => $html)); $dom = new \DOMDocument(); // Ignore warnings during HTML soup loading. @$dom->loadHTML($document); $element = $dom->getElementsByTagName('body')->item(0); echo $element->ownerDocument->saveXML($element);
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.32, 8.3.0 - 8.3.32, 8.4.1 - 8.4.24, 8.5.0 - 8.5.9
<body><drupal-render-placeholder callback="poll.post_render_cache:renderViewForm" arguments="id=1&amp;view_mode=np8_sidebar" token="e450a32c"></drupal-render-placeholder></body>

preferences:
109.3 ms | 2236 KiB | 4 Q