3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $encoding = 'utf-8'; $orig = PHP_VERSION_ID < 50600 ? iconv_get_encoding('internal_encoding') : ini_get('default_charset'); if (PHP_VERSION_ID < 50600) { if ($encoding) { $result = iconv_set_encoding('internal_encoding', $encoding); } else { $result = false; } } else { ini_set('default_charset', $encoding); $result = ini_get('default_charset'); } if (!$result) { echo 'Given encoding not supported on this OS!'; } else { echo 'All good'; }
based on dEboh
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
All good