3v4l.org

run code in 300+ PHP versions simultaneously
<?php function safehtml ($str) { if (isset($GLOBALS['encoding'])) { $encoding = $GLOBALS['encoding']; } else { $encoding = 'ISO-8859-1'; } if (defined("ENT_XHTML")) { $newstr = htmlentities($str, ENT_COMPAT | ENT_XHTML, $encoding); // FIND-PHP-IGNORE-LINE-P$ } else { $newstr = htmlentities($str, ENT_COMPAT, $encoding); // FIND-PHP-IGNORE-LINE-PAUL } if (strlen($str) !== 0 && strlen($newstr) === 0) { trigger_error('safehtml returned blank string. Input: "'.$str.'"'); } return $newstr; } safehtml("hello world"); ?>
Output for git.master, git.master_jit, rfc.property-hooks

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