3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //header('Content-Type: text/html; charset=utf-8'); $str = "颜色代码"; var_dump(strpos($str, "代")); var_dump(mb_strpos($str, utf8_decode("颜色"), 0 ,"GBK"));
Output for 4.3.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
int(6) bool(false)
Output for 4.3.2 - 4.3.3
int(6) Warning: mb_strpos(): Unknown encoding "GBK" in /in/Mm0E1 on line 9 bool(false)
Output for 4.3.0 - 4.3.1
int(6) Warning: mb_strpos() [http://www.php.net/function.mb-strpos]: Unknown encoding "GBK" in /in/Mm0E1 on line 9 bool(false)