3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument('1.0', 'UTF-8'); $doc->loadHTML(mb_convert_encoding('<p>Трололо!</p>', 'HTML-ENTITIES', 'UTF-8')); $xpath = new DOMXPath($doc); $child = $xpath->query('//p')->item(0); if (version_compare(PHP_VERSION, '5.3.6', '>=')) { var_dump($child->ownerDocument->saveHTML($child)); } else { $document = new \DOMDocument('1.0', 'UTF-8'); $document->appendChild($document->importNode($child, true)); var_dump(rtrim($document->saveHTML())); }
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: mb_convert_encoding(): Handling HTML entities via mbstring is deprecated; use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead in /in/JmGWM on line 4 string(22) "<p>Трололо!</p>"

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:
34.49 ms | 401 KiB | 8 Q