Doc #62180 [NEW]: Example #2 for intl's MessageFormatter is incorrect
| From: | jausions@php.net | Date: | Tue, 29 May 2012 10:47:00 +0000 |
| Subject: | Doc #62180 [NEW]: Example #2 for intl's MessageFormatter is incorrect | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-8406@lists.php.net to get a copy of this message | ||
From: jausions
Operating system: Irrelevant
PHP version: Irrelevant
Package: intl
Bug Type: Documentation Problem
Bug description:Example #2 for intl's MessageFormatter is incorrect
Description:
------------
---
From manual page:
http://www.php.net/messageformatter.formatmessage#refsect1-messageformatter.formatmessage-examples
---
Object-oriented example #2 incorrectly duplicates the procedure example.
Expected result:
----------------
<?php
echo MessageFormatter::formatMessage("en_US", "{0,number,integer} monkeys
on {1,number,integer} trees make {2,number} monkeys per tree", array(4560,
123, 4560/123));
echo MessageFormatter::formatMessage("de", "{0,number,integer} Affen auf
{1,number,integer} Bäumen sind {2,number} Affen pro Baum", array(4560,
123, 4560/123));
?>
Actual result:
--------------
<?php
echo msgfmt_format_message("en_US", "{0,number,integer} monkeys on
{1,number,integer} trees make {2,number} monkeys per tree", array(4560,
123, 4560/123));
echo msgfmt_format_message("de", "{0,number,integer} Affen auf
{1,number,integer} Bäumen sind {2,number} Affen pro Baum", array(4560,
123, 4560/123));
?>
--
Edit bug report at https://bugs.php.net/bug.php?id=62180&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62180&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62180&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62180&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=62180&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62180&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=62180&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=62180&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=62180&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=62180&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=62180&r=support
Expected behavior: https://bugs.php.net/fix.php?id=62180&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=62180&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=62180&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=62180&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62180&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=62180&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=62180&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=62180&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=62180&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=62180&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=62180&r=mysqlcfg