3v4l.org

run code in 300+ PHP versions simultaneously
<?php $exclude = 'BASE64,UUENCODE,HTML-ENTITIES,Quoted-Printable,' . '7bit,8bit,pass,wchar,byte2be,byte2le,byte4be,byte4le,' . 'UCS-4,UCS-4BE,UCS-4LE,UCS-2,UCS-2BE,UCS-2LE'; $prio = [ 'UTF-8', 'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-3', 'ISO-8859-4', 'ISO-8859-5', 'ISO-8859-6', 'ISO-8859-7', 'ISO-8859-8', 'ISO-8859-9', 'ISO-8859-10', 'ISO-8859-13', 'ISO-8859-14', 'ISO-8859-15', 'ISO-8859-16', 'WINDOWS-1252', 'WINDOWS-1251', 'WINDOWS-1254', 'EUC-JP', 'EUC-TW', 'KOI8-R', 'BIG-5', 'ISO-2022-KR', 'ISO-2022-JP', 'GB18030', ]; $all_encodings = array_diff(mb_list_encodings(), explode(',', $exclude)); $encodings = array_unique(array_merge($prio, $all_encodings)); $test = 'Iksi' . chr(241) . 'ski'; echo mb_detect_encoding($test, $encodings);
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.3.0 - 8.3.4, 8.3.6
ISO-8859-1
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 ISO-8859-1
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
SJIS-2004

preferences:
155.93 ms | 402 KiB | 156 Q