Doc #76880 [Ver->Csd]: Documentation shows case that cannot be used
| From: | cmb@php.net | Date: | Fri, 14 Sep 2018 11:45:46 +0000 |
| Subject: | Doc #76880 [Ver->Csd]: Documentation shows case that cannot be used | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-15995@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76880&edit=1
ID: 76880
Updated by: cmb@php.net
Reported by: kaisa dot lehikoinen at bromangroup dot fi
Summary: Documentation shows case that cannot be used
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: intl
PHP Version: 7.2.10
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2018-09-14 11:44:35] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=345633
Log: Fix #76880: Documentation shows case that cannot be used
The example is invalid as of PHP 5.5.0, so we remove it.
Anybody with a working example?
------------------------------------------------------------------------
[2018-09-14 10:51:47] cmb@php.net
Confirmed: <https://3v4l.org/8oJsn>.
------------------------------------------------------------------------
[2018-09-14 08:47:16] kaisa dot lehikoinen at bromangroup dot fi
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 this bug report at https://bugs.php.net/bug.php?id=76880&edit=1