3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = "Café & 'quotes' and € euro"; // ISO-8859-1 mode var_dump( htmlentities($string, ENT_QUOTES, "big5")); // empty string var_dump( htmlentities($string, ENT_QUOTES, "xxx")); // default to utf8 // Caf&eacute; &amp; &#039;quotes&#039; and &euro; euro
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.21, 8.5.0 - 8.5.6
Notice: htmlentities(): Only basic entities substitution is supported for multi-byte encodings other than UTF-8; functionality is equivalent to htmlspecialchars in /in/1vaRr on line 6 string(0) "" Warning: htmlentities(): Charset "xxx" is not supported, assuming UTF-8 in /in/1vaRr on line 9 string(52) "Caf&eacute; &amp; &#039;quotes&#039; and &euro; euro"
Output for 7.4.0 - 7.4.33
Notice: htmlentities(): Only basic entities substitution is supported for multi-byte encodings other than UTF-8; functionality is equivalent to htmlspecialchars in /in/1vaRr on line 6 string(0) "" Warning: htmlentities(): charset `xxx' not supported, assuming utf-8 in /in/1vaRr on line 9 string(52) "Caf&eacute; &amp; &#039;quotes&#039; and &euro; euro"
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33
Strict Standards: htmlentities(): Only basic entities substitution is supported for multi-byte encodings other than UTF-8; functionality is equivalent to htmlspecialchars in /in/1vaRr on line 6 string(0) "" Warning: htmlentities(): charset `xxx' not supported, assuming utf-8 in /in/1vaRr on line 9 string(52) "Caf&eacute; &amp; &#039;quotes&#039; and &euro; euro"
Output for 5.2.12 - 5.2.17, 5.3.2 - 5.3.29
string(0) "" Warning: htmlentities(): charset `xxx' not supported, assuming iso-8859-1 in /in/1vaRr on line 9 string(65) "Caf&Atilde;&copy; &amp; &#039;quotes&#039; and &acirc;�&not; euro"
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.1 - 5.1.6, 5.2.0 - 5.2.11, 5.3.0 - 5.3.1
string(53) "Café &amp; &#039;quotes&#039; and &acirc;�&not; euro" Warning: htmlentities(): charset `xxx' not supported, assuming iso-8859-1 in /in/1vaRr on line 9 string(65) "Caf&Atilde;&copy; &amp; &#039;quotes&#039; and &acirc;�&not; euro"
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/1vaRr on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1

Process exited with code 139.

preferences:
62.52 ms | 2850 KiB | 4 Q