|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-04-12 13:15 UTC] ab@php.net
-Status: Open
+Status: Not a bug
[2016-04-12 13:15 UTC] ab@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 22 07:00:01 2025 UTC |
Description: ------------ MessageFormatter::format() accepted named arguments to create strings, but MessageFormatter::parse() dont output named array indices. Test script: --------------- $messageFormatter = new MessageFormatter(NULL, 'foo {0}, bar {1}'); $output = $messageFormatter->format(array( 23, 42 )); var_dump($output); var_dump($messageFormatter->parse($output)); $messageFormatter = new MessageFormatter(NULL, 'foo {foo}, bar {bar}'); $output = $messageFormatter->format(array( 'foo' => 23, 'bar' => 42 )); var_dump($output); var_dump($messageFormatter->parse($output)); Expected result: ---------------- string(14) "foo 23, bar 42" array(2) { [0]=> string(2) "23" [1]=> string(2) "42" } string(14) "foo 23, bar 42" array(2) { [foo]=> string(2) "23" [bar]=> string(2) "42" } Actual result: -------------- string(14) "foo 23, bar 42" array(2) { [0]=> string(2) "23" [1]=> string(2) "42" } string(14) "foo 23, bar 42" bool(false)