Doc #76880 [NEW]: Documentation shows case that cannot be used
| From: | kaisa dot lehikoinen at bromangroup dot fi | Date: | Fri, 14 Sep 2018 08:47:16 +0000 |
| Subject: | Doc #76880 [NEW]: Documentation shows case that cannot be used | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-15990@lists.php.net to get a copy of this message | ||
From: kaisa dot lehikoinen at bromangroup dot fi
Operating system:
PHP version: 7.2.10
Package: *Languages/Translation
Bug Type: Documentation Problem
Bug description:Documentation shows case that cannot be used
Description:
------------
---
From manual page: http://www.php.net/messageformatter.geterrorcode
---
The example error in documentation does not exist anymore (as of
http://au1.php.net/manual/en/migration55.changed-functions.php).
There
is no possible way of catching the case when insufficient number of
arguments is given with MessageFormatter
Test script:
---------------
$locale='fi_FI';
$pattern="{gender, select, female { Hello Missis {name}! } male { Hello
Mister {name}! } other {Hello {name}!}}";
$params=array();
$MessageFormatter= new \MessageFormatter($locale, $pattern);
$phrase= $MessageFormatter->format($params);
if(!$phrase) { //this part does not catch insufficient number of
arguments error
$error=$MessageFormatter->getErrorMessage();
echo 'error:'.$error;
}
return $phrase;
Expected result:
----------------
error: not enough parameters: U_ILLEGAL_ARGUMENT_ERROR (1)
Actual result:
--------------
Hello {name}!
--
Edit bug report at https://bugs.php.net/bug.php?id=76880&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76880&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76880&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76880&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76880&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76880&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76880&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76880&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76880&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76880&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76880&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76880&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76880&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76880&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76880&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76880&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76880&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76880&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76880&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76880&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76880&r=mysqlcfg