Edit report at https://bugs.php.net/bug.php?id=60166&edit=1
ID: 60166 User updated by: np dot viktorov at gmail dot com Reported by: np dot viktorov at gmail dot com Summary: Locale::lookup() returns an empty string if the first arg is an empty array Status: Open Type: Bug Package: intl Operating System: Debian GNU/Linux 6.0.2 (squeeze) PHP Version: Irrelevant Block user comment: N Private report: N New Comment: I forgot the INTL information. According to phpinfo() the INTL version information is this: - version 1.1.0 - ICU version 4.4.1 Previous Comments: ------------------------------------------------------------------------ [2011-10-29 11:24:32] np dot viktorov at gmail dot com Description: ------------ Locale::lookup() will return an empty string if the first argument is an empty array() no matter that we have already set the default argument (argument #4) Test script: --------------- <?php $available = array(); $default = "en"; $requested = "eu-us"; $result = Locale::lookup($available, $requested, null, $default); var_dump($result); /* if we create atleast one element, for example "de" it will work fine */ Expected result: ---------------- According to the documentation we should expect to get "en" because this is the default locale provided as the fourth argument. This doesn't happen. Actual result: -------------- The actual result is "" (an empty string), not null, not false, just an empty string. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60166&edit=1