3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $input = "Premium serviço Personal - 1 m�"; var_dump( iconv("UTF-8", "UTF-8//IGNORE", $input) ); var_dump( utf8_encode(utf8_decode($input)) ); var_dump( utf8_encode($input) ); var_dump( utf8_decode($input) ); var_dump( mb_convert_encoding($input, 'utf-8', 'utf-8') ); var_dump( filter_var($input, FILTER_SANITIZE_ENCODED, FILTER_FLAG_STRIP_LOW) ); var_dump(preg_replace('#[\x00-\x08\x0B-\x1F\x7F-\x9F]+#u', '', $input)) ; var_dump(htmlspecialchars($input, ENT_NOQUOTES | ENT_IGNORE, 'UTF-8')); var_dump(htmlspecialchars_decode(htmlspecialchars($input, ENT_NOQUOTES | ENT_IGNORE, 'UTF-8'), ENT_NOQUOTES)); $input = 'Premium serviço Personal - 1 mês'; var_dump( iconv("UTF-8", "UTF-8//IGNORE", $input) ); var_dump( utf8_encode(utf8_decode($input)) ); var_dump( utf8_encode($input) ); var_dump( utf8_decode($input) ); var_dump( mb_convert_encoding($input, 'utf-8', 'utf-8') ); var_dump( filter_var($input, FILTER_SANITIZE_ENCODED, FILTER_FLAG_STRIP_LOW) ); var_dump(preg_replace('#[\x00-\x08\x0B-\x1F\x7F-\x9F]+#u', '', $input)) ; var_dump(htmlspecialchars($input, ENT_NOQUOTES | ENT_IGNORE, 'UTF-8')); var_dump(htmlspecialchars_decode(htmlspecialchars($input, ENT_NOQUOTES | ENT_IGNORE, 'UTF-8'), ENT_NOQUOTES));
based on m9Zu3
Output for 5.3.19 - 5.5.34, 5.6.8 - 5.6.20, 5.6.28 - 7.0.5, 7.0.20 - 7.2.0
string(34) "Premium serviço Personal - 1 m�" string(32) "Premium serviço Personal - 1 m?" string(39) "Premium serviço Personal - 1 m�" string(31) "Premium servi�o Personal - 1 m?" string(34) "Premium serviço Personal - 1 m�" string(54) "Premium%20servi%C3%A7o%20Personal%20-%201%20m%EF%BF%BD" string(34) "Premium serviço Personal - 1 m�" string(34) "Premium serviço Personal - 1 m�" string(34) "Premium serviço Personal - 1 m�" string(34) "Premium serviço Personal - 1 mês" string(34) "Premium serviço Personal - 1 mês" string(38) "Premium serviço Personal - 1 mês" string(32) "Premium servi�o Personal - 1 m�s" string(34) "Premium serviço Personal - 1 mês" string(52) "Premium%20servi%C3%A7o%20Personal%20-%201%20m%C3%AAs" string(34) "Premium serviço Personal - 1 mês" string(34) "Premium serviço Personal - 1 mês" string(34) "Premium serviço Personal - 1 mês"
Output for 7.0.6
Fatal error: Uncaught Error: Call to undefined function iconv() in /in/depIH:4 Stack trace: #0 {main} thrown in /in/depIH on line 4
Process exited with code 255.
Output for 5.5.35, 5.6.21
Fatal error: Call to undefined function iconv() in /in/depIH on line 4
Process exited with code 255.