Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 143312 - php-5.1.4-r4 fails test code found in gettext
Summary: php-5.1.4-r4 fails test code found in gettext
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-09 03:21 UTC by Yura Kudryashov
Modified: 2006-09-30 08:55 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yura Kudryashov 2006-08-09 03:21:53 UTC
# 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...
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-08-09 03:48:27 UTC
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.

Comment 2 Yura Kudryashov 2006-08-09 05:04:00 UTC
(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?
Comment 3 SpanKY gentoo-dev 2006-08-09 09:31:13 UTC
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 ...] )
Comment 4 Yura Kudryashov 2006-08-09 10:52:48 UTC
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.
Comment 5 SpanKY gentoo-dev 2006-09-23 09:26:52 UTC
the correct output is "a1"
Comment 6 Luca Longinotti (RETIRED) gentoo-dev 2006-09-23 09:44:49 UTC
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.
Comment 7 Luca Longinotti (RETIRED) gentoo-dev 2006-09-30 08:55:17 UTC
No response from anyone, nothing broken on our side, it's assigned to us... Closing this!
Best regards, CHTEKK.