3v4l.org

run code in 300+ PHP versions simultaneously
<?php $some_string = "Ку ку"; $arra_c = array( "UTF-8", "ASCII", "ISO-8859-1", "ISO-8859-2", "ISO-8859-3", "ISO-8859-4", "ISO-8859-6", "ISO-8859-7", "ISO-8859-8", "ISO-8859-9", "ISO-8859-10", "ISO-8859-13", "ISO-8859-14", "ISO-8859-15", "HZ", "EUC-TW", "CP950", "BIG-5", "EUC-KR", "UHC",// (CP949) "ISO-2022-KR", "Windows-1251",// (CP1251) "Windows-1252",// (CP1252) "CP866",// (IBM866) "KOI8-R"); foreach($arra_c as $k => $v){ var_dump(mb_convert_encoding($some_string,$v,"UTF-8" ). "-" . $v ." # ". strlen(json_encode(array('message' => mb_convert_encoding($some_string,$v,"UTF-8" ))))); } //var_dump(mb_detect_encoding($some_string)); //var_dump(strlen(json_encode(array('message' => $some_string))));
Output for git.master, git.master_jit, rfc.property-hooks
string(20) "Ку ку-UTF-8 # 39" string(16) "?? ??-ASCII # 19" string(21) "?? ??-ISO-8859-1 # 19" string(21) "?? ??-ISO-8859-2 # 19" string(21) "?? ??-ISO-8859-3 # 19" string(21) "?? ??-ISO-8859-4 # 19" string(21) "?? ??-ISO-8859-6 # 19" string(21) "?? ??-ISO-8859-7 # 19" string(21) "?? ??-ISO-8859-8 # 19" string(21) "?? ??-ISO-8859-9 # 19" string(22) "?? ??-ISO-8859-10 # 19" string(22) "?? ??-ISO-8859-13 # 19" string(22) "?? ??-ISO-8859-14 # 19" string(22) "?? ??-ISO-8859-15 # 19" string(25) "~{','e~} ~{'\'e~}-HZ # 32" string(17) "?? ??-EUC-TW # 19" string(16) "?? ??-CP950 # 19" string(19) "Ǹ�� ����-BIG-5 # 0" string(20) "���� �ܬ�-EUC-KR # 0" string(17) "���� �ܬ�-UHC # 0" string(34) "$)C,,,e ,\,e-ISO-2022-KR # 57" string(22) "�� ��-Windows-1251 # 0" string(23) "?? ??-Windows-1252 # 19" string(15) "�� ��-CP866 # 0" string(16) "�� ��-KOI8-R # 0"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
45.75 ms | 403 KiB | 8 Q