From:             
Operating system: Ubuntu 9.10
PHP version:      5.3.2
Package:          *Languages/Translation
Bug Type:         Bug
Bug description:Error creating MessageFormatter object with nested tags

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 bug report at http://bugs.php.net/bug.php?id=52042&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=52042&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=52042&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=52042&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=52042&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52042&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=52042&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=52042&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=52042&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=52042&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=52042&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=52042&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=52042&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=52042&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=52042&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=52042&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=52042&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=52042&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=52042&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=52042&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=52042&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=52042&r=mysqlcfg

Reply via email to