3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $pass = 'asdf&ddddd"fancy˝quotes˝'; echo htmlspecialchars($text, ENT_COMPAT | ENT_HTML401, 'UTF-8') . "\n"; // Output: asdf&amp;ddddd&quot;fancyË echo htmlentities($text, ENT_COMPAT | ENT_HTML401, 'UTF-8') . "\n"; // Output: asdf&amp;ddddd&quot;fancy&Euml;quotes
Output for 5.4.0 - 7.1.0
Notice: Undefined variable: text in /in/NMj8q on line 4 Notice: Undefined variable: text in /in/NMj8q on line 7
Output for 5.0.4 - 5.0.5, 5.1.1 - 5.3.29
Notice: Undefined variable: text in /in/NMj8q on line 4 Notice: Use of undefined constant ENT_HTML401 - assumed 'ENT_HTML401' in /in/NMj8q on line 4 Notice: Undefined variable: text in /in/NMj8q on line 7 Notice: Use of undefined constant ENT_HTML401 - assumed 'ENT_HTML401' in /in/NMj8q on line 7
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/NMj8q on line 8
Process exited with code 255.
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: text in /in/NMj8q on line 4 Notice: Use of undefined constant ENT_HTML401 - assumed 'ENT_HTML401' in /in/NMj8q on line 4 Notice: Undefined variable: text in /in/NMj8q on line 7 Notice: Use of undefined constant ENT_HTML401 - assumed 'ENT_HTML401' in /in/NMj8q on line 7