1--TEST-- 2mb_ord() 3--SKIPIF-- 4<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?> 5--FILE-- 6<?php 7var_dump( 8 0x20bb7 === mb_ord("\u{20bb7}"), 9 false === mb_ord("\u{d800}"), 10 0x50aa === mb_ord("\x8f\xa1\xef", "EUC-JP-2004") 11); 12 13// Invalid 14var_dump( 15 mb_ord("\u{d800}", "typo"), 16 mb_ord("\u{d800}", "pass"), 17 mb_ord("\u{d800}", "jis"), 18 mb_ord("\u{d800}", "cp50222"), 19 mb_ord("\u{d800}", "utf-7"), 20 mb_ord("") 21); 22?> 23--EXPECTF-- 24bool(true) 25bool(true) 26bool(true) 27 28Warning: mb_ord(): Unknown encoding "typo" %s 10 29 30Warning: mb_ord(): Unsupported encoding "pass" %s 11 31 32Warning: mb_ord(): Unsupported encoding "jis" %s 12 33 34Warning: mb_ord(): Unsupported encoding "cp50222" %s 13 35 36Warning: mb_ord(): Unsupported encoding "utf-7" %s 14 37 38Warning: mb_ord(): Empty string in %s on line %d 39bool(false) 40bool(false) 41bool(false) 42bool(false) 43bool(false) 44bool(false) 45