3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "don&#39;t-break-me-überÆØÅ!"; print htmlspecialchars_decode($str, ENT_QUOTES) . PHP_EOL; print html_entity_decode($str, ENT_QUOTES) . PHP_EOL; print html_entity_decode($str, ENT_QUOTES, 'ISO-8859-1') . PHP_EOL; print html_entity_decode($str, ENT_QUOTES | ENT_XML1, 'ISO-8859-1') . PHP_EOL; print html_entity_decode($str, ENT_QUOTES, 'UTF-8') . PHP_EOL; // Decode ALL entities (double quotes (&#34;), // single quotes (&#39; + &apos;) and non printable chars (e.g. &#13;)) print html_entity_decode($str, ENT_QUOTES | ENT_XML1, 'UTF-8') . PHP_EOL; // Convert &#[0-9]+ entities to UTF-8 $new = preg_replace_callback("/(&#[0-9]+;)/", function($m) { return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES"); }, $str); print $new . PHP_EOL; // Convert &#[0-9]+ entities to ISO-8859-1 $new2 = preg_replace_callback("/(&#[0-9]+;)/", function($m) { return mb_convert_encoding($m[1], "ISO-8859-1", "HTML-ENTITIES"); }, $str); print $new2 . PHP_EOL;
Output for git.master, git.master_jit, rfc.property-hooks
don't-break-me-überÆØÅ! don't-break-me-überÆØÅ! don't-break-me-überÆØÅ! don't-break-me-überÆØÅ! don't-break-me-überÆØÅ! don't-break-me-überÆØÅ! don't-break-me-überÆØÅ! don't-break-me-überÆØÅ!

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