Doc #68066 [NEW]: blank locale in IntlDateFormatter::formatObject return international format

From: Date: Sat, 20 Sep 2014 23:14:42 +0000
Subject: Doc #68066 [NEW]: blank locale in IntlDateFormatter::formatObject return international format
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-11487@lists.php.net to get a copy of this message
From: dgoosens at gmail dot com Operating system: Ubuntu 14.04 PHP version: Irrelevant Package: I18N and L10N related Bug Type: Documentation Problem Bug description:blank locale in IntlDateFormatter::formatObject return international format Description: ------------ when passing a blank space instead of NULL or a valid locale, the \IntlDateFormatter::formatObject returns an international formatted string... I'm thinking this is the apropriate behavior but it is not documented... Documentation states : [http://be2.php.net/manual/en/intldateformatter.formatobject.php] locale The locale to use, or NULL to use the default one. Test script: --------------- <?php $dateTime = new \DateTime(); echo \IntlDateFormatter::formatObject($dateTime, \IntlDateFormatter::NONE, null); echo PHP_EOL; echo \IntlDateFormatter::formatObject($dateTime, \IntlDateFormatter::NONE, ''); echo PHP_EOL; echo PHP_EOL; echo \IntlDateFormatter::formatObject($dateTime, \IntlDateFormatter::SHORT, null); echo PHP_EOL; echo \IntlDateFormatter::formatObject($dateTime, \IntlDateFormatter::SHORT, ''); echo PHP_EOL; echo PHP_EOL; echo \IntlDateFormatter::formatObject($dateTime, \IntlDateFormatter::MEDIUM, null); echo PHP_EOL; echo \IntlDateFormatter::formatObject($dateTime, \IntlDateFormatter::MEDIUM, ''); echo PHP_EOL; echo PHP_EOL; echo \IntlDateFormatter::formatObject($dateTime, \IntlDateFormatter::LONG, null); echo PHP_EOL; echo \IntlDateFormatter::formatObject($dateTime, \IntlDateFormatter::LONG, ''); echo PHP_EOL; echo PHP_EOL; echo \IntlDateFormatter::formatObject($dateTime, \IntlDateFormatter::FULL, null); echo PHP_EOL; echo \IntlDateFormatter::formatObject($dateTime, \IntlDateFormatter::FULL, ''); Expected result: ---------------- Either the script should throw a warning or the documentation needs an update to illustrate the actual behavior Actual result: -------------- 20140921 01:04 AM 20140921 01:04 AM 9/21/14, 1:04 AM 2014-09-21 01:04 Sep 21, 2014, 1:04:40 AM 2014 M09 21 01:04:40 September 21, 2014 at 1:04:40 AM GMT+2 2014 M09 21 01:04:40 GMT+2 Sunday, September 21, 2014 at 1:04:40 AM Central European Summer Time 2014 M09 21, Sun 01:04:40 GMT+02:00 -- Edit bug report at https://bugs.php.net/bug.php?id=68066&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68066&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68066&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68066&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=68066&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=68066&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=68066&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=68066&r=needscript Try newer version: https://bugs.php.net/fix.php?id=68066&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=68066&r=support Expected behavior: https://bugs.php.net/fix.php?id=68066&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=68066&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=68066&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=68066&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68066&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=68066&r=dst IIS Stability: https://bugs.php.net/fix.php?id=68066&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=68066&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=68066&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=68066&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=68066&r=mysqlcfg

« previous php.doc.bugs (#11487) next »