From: Operating system: Debian GNU/Linux 6.0.2 (squeeze) PHP version: Irrelevant Package: intl Bug Type: Bug Bug description:Locale::lookup() returns an empty string if the first arg is an empty array
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 bug report at https://bugs.php.net/bug.php?id=60166&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60166&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60166&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60166&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60166&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60166&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60166&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60166&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60166&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60166&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60166&r=support Expected behavior: https://bugs.php.net/fix.php?id=60166&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60166&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60166&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60166&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60166&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60166&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60166&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60166&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60166&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60166&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60166&r=mysqlcfg