Doc #62180 [Asn->Csd]: Example #2 for intl's MessageFormatter is incorrect

From: Date: Sun, 22 Dec 2013 15:34:47 +0000
Subject: Doc #62180 [Asn->Csd]: Example #2 for intl's MessageFormatter is incorrect
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-10729@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62180&edit=1 ID: 62180 Updated by: salathe@php.net Reported by: jausions@php.net Summary: Example #2 for intl's MessageFormatter is incorrect -Status: Assigned +Status: Closed Type: Documentation Problem Package: intl Operating System: Irrelevant PHP Version: Irrelevant Assigned To: stas Block user comment: N Private report: N New Comment: The fix for this bug has been committed. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2012-05-29 10:47:00] jausions@php.net 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 this bug report at https://bugs.php.net/bug.php?id=62180&edit=1

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