Edit report at http://bugs.php.net/bug.php?id=52042&edit=1
ID: 52042
User updated by: zabruska at tugamail dot pt
Reported by: zabruska at tugamail dot pt
Summary: Error creating MessageFormatter object with nested
tags
Status: Open
Type: Bug
Package: *Languages/Translation
Operating System: Ubuntu 9.10
PHP Version: 5.3.2
New Comment:
Escaping the tags makes no difference either
Previous Comments:
------------------------------------------------------------------------
[2010-06-11 01:52:14] zabruska at tugamail dot pt
Description:
------------
Calling msgfmt_create(...) or new MessageFormatter(...) with patterns
having nested tags will return null.
Apparently the same happens with empty patterns, but returning NULL from
an object constructor is a SERIOUS bug.
Test script:
---------------
$f1 = new MessageFormatter('en_US', '{what is wrong {0} with this
pattern ???}');
echo 'f1 is ', gettype($f1), PHP_EOL;
$f2 = MessageFormatter::create('en_US', '{what is wrong {0} with this
pattern ???}');
echo 'f2 is ', gettype($f2), PHP_EOL;
$f3 = msgfmt_create('en_US', '{what is wrong {0} with this pattern
???}');
echo 'f3 is ', gettype($f3), PHP_EOL;
Expected result:
----------------
f1 is object
f2 is object
f3 is object
Actual result:
--------------
f1 is NULL
f2 is NULL
f3 is NULL
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52042&edit=1