3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo $str = "Coss&eacute; René"; echo "\n"; echo $str = htmlentities($str,ENT_XML1,UTF-8); echo "\n"; echo $str = html_entity_decode($str); echo "\n";
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Coss&eacute; René Fatal error: Uncaught Error: Undefined constant "UTF" in /in/D4Cv6:4 Stack trace: #0 {main} thrown in /in/D4Cv6 on line 4
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Coss&eacute; René Warning: Use of undefined constant UTF - assumed 'UTF' (this will throw an Error in a future version of PHP) in /in/D4Cv6 on line 4 Warning: A non-numeric value encountered in /in/D4Cv6 on line 4 Warning: htmlentities(): charset `-8' not supported, assuming utf-8 in /in/D4Cv6 on line 4 Coss&amp;eacute; René Coss&eacute; René
Output for 7.1.0 - 7.1.33
Coss&eacute; René Notice: Use of undefined constant UTF - assumed 'UTF' in /in/D4Cv6 on line 4 Warning: A non-numeric value encountered in /in/D4Cv6 on line 4 Warning: htmlentities(): charset `-8' not supported, assuming utf-8 in /in/D4Cv6 on line 4 Coss&amp;eacute; René Coss&eacute; René
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20
Coss&eacute; René Notice: Use of undefined constant UTF - assumed 'UTF' in /in/D4Cv6 on line 4 Warning: htmlentities(): charset `-8' not supported, assuming utf-8 in /in/D4Cv6 on line 4 Coss&amp;eacute; René Coss&eacute; René

preferences:
213.26 ms | 402 KiB | 257 Q