|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-09-05 23:34 UTC] felipe@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: stas
[2011-04-17 23:58 UTC] stas@php.net
-Package: *Languages/Translation
+Package: I18N and L10N related
[2011-04-17 23:58 UTC] stas@php.net
-Type: Bug
+Type: Feature/Change Request
[2012-02-21 10:20 UTC] jinmoku at hotmail dot com
[2012-02-26 12:05 UTC] clicky at erebot dot net
[2013-02-17 10:46 UTC] stas@php.net
-Assigned To: stas
+Assigned To:
[2015-01-15 20:34 UTC] danack@php.net
-Assigned To:
+Assigned To: danack
[2015-01-15 20:34 UTC] danack@php.net
[2015-05-08 08:57 UTC] clicky at erebot dot net
[2015-08-07 00:55 UTC] cmb@php.net
-Status: Assigned
+Status: Closed
[2015-08-07 00:55 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 03:00:02 2025 UTC |
Description: ------------ MessageFormatter's constructor returns NULL when an invalid pattern is given. Instead, it should throw an exception. This bug has already been reported twice before (see #52042 & #49161). Each time the report was marked as bogus because the real problem got overlooked. (the problem lies not in the given pattern being considered invalid by ICU, the problem is in the constructor returning NULL) Test script: --------------- <?php $f1 = msgfmt_create('en_US', '{this was made intentionally incorrect}'); echo 'f1 is ', gettype($f1), PHP_EOL; $f2 = MessageFormatter::create('en_US', '{this was made intentionally incorrect}'); echo 'f2 is ', gettype($f2), PHP_EOL; $f3 = new MessageFormatter('en_US', '{this was made intentionally incorrect}'); echo 'f3 is ', gettype($f3), PHP_EOL; ?> Expected result: ---------------- f1 is NULL f2 is NULL Fatal error: Uncaught exception 'Exception' with message 'Invalid pattern' in %s:%d. Actual result: -------------- f1 is NULL f2 is NULL f3 is NULL