# php --version PHP 5.1.4-pl4-gentoo (cli) (built: Jul 16 2006 03:05:40) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies lang-php test fails. Problem is in following: # php <<EOF <? echo printf ("%s", "a"); echo "\n"; ?> EOF a1 # So, echo printf(_("%s is replaced by %s."), "FF", "EUR"); prints not only translated string (as expected by prog.ok), but also number of characters in this string. When I replaced printf with sprintf, test passed. I don't know, is it php bug, or gettext testsuite bug, or php incompatibility...
http://www.php.net/printf Produces output according to format, which is described in the documentation for sprintf(). Returns the length of the outputted string.
(In reply to comment #1) > http://www.php.net/printf > > Produces output according to format, which is described in the documentation > for sprintf(). Returns the length of the outputted string. > So, printf () returns length of the outputted string, and echo () prints this length. Am I right?
read the manual: http://www.php.net/printf int printf ( string format [, mixed args [, mixed ...]] ) http://www.php.net/echo void echo ( string arg1 [, string ...] )
Please, read the example in the description. If output should be a1 then there is a bug in gettext's lang-php test. If output should be a then there is a bug in dev-lang/php-5.1.4-r4. Both packages are compiled from portage.
the correct output is "a1"
Hmmm why did you reassing this to us? "a1" is the expected format according to the PHP manual, it is what gets output when using printf() and PHP passes all it's own tests (make test) in this regard... So what's this broken "lang-php" test thingie??? It's not any package owned by the PHP herd, and our dev-lang/php tests all pass, so I'm at loss here... ??? Best regards, CHTEKK.
No response from anyone, nothing broken on our side, it's assigned to us... Closing this! Best regards, CHTEKK.