3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "LIBXML_DOTTED_VERSION: " . LIBXML_DOTTED_VERSION . "\n\n"; $dom = new DOMDocument(); $dom->preserveWhiteSpace = true; $dom->formatOutput = false; $dom->loadHTML( "<!DOCTYPE html><html><head><meta charset=utf-8></head><body><ul><li>First</li><li>Second</li></ul></body></html>" ); echo "# \$dom->saveHTML( \$dom->documentElement ):\n"; $first = trim( $dom->saveHTML( $dom->documentElement ) ); echo $first; echo "\n"; echo "\n"; echo "# ~\$dom->saveHTML():\n"; $second = trim( str_replace( "<!DOCTYPE html>\n", "", $dom->saveHTML() ) ); echo $second; echo "\n\n"; echo $first === $second ? "PASS" : "FAIL";
Output for git.master_jit, git.master, rfc.property-hooks
LIBXML_DOTTED_VERSION: 2.9.4 # $dom->saveHTML( $dom->documentElement ): <html><head><meta charset="utf-8"></head><body><ul><li>First</li><li>Second</li></ul></body></html> # ~$dom->saveHTML(): <html><head><meta charset="utf-8"></head><body><ul><li>First</li><li>Second</li></ul></body></html> PASS

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:
56.26 ms | 402 KiB | 8 Q