php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26973 printf format
Submitted: 2004-01-20 06:08 UTC Modified: 2004-01-20 23:03 UTC
From: alex at cartel dot md Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4CVS, 5CVS OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: alex at cartel dot md
New email:
PHP Version: OS:

 

 [2004-01-20 06:08 UTC] alex at cartel dot md
Description:
------------
printf function pads incorrectly with zeros and sign.


Reproduce code:
---------------
<?
printf("%+05d", 200);
?>


Expected result:
----------------
+0200

Actual result:
--------------
0+200

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-20 19:16 UTC] sniper@php.net
With C, it works as expected -> gotta be bug? :)

 [2004-01-20 23:03 UTC] sniper@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2004-08-04 09:10 UTC] edreddy at gmail dot com
still it is failed. The test script ext/standarad/tests/strings/bug26973.phpt is failed solaris. The version used is php-4.3.8
 [2004-08-04 09:19 UTC] edreddy at gmail dot com
================================================================================
/home/deadala/test_setup/php_tests/ext/standard/tests/strings/bug26973.phpt
================================================================================

---- EXPECTED OUTPUT
+0200
-0200
+0200.000000
-0200.000000
00200
4294967096
---
00200
-0200
00200.000000
-0200.000000
00200
4294967096
---- ACTUAL OUTPUT
+0200
-0200
+200.000000
-200.000000
00200
4294967096
---
00200
-0200
200.000000
-200.000000
00200
4294967096
---- FAILED
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 00:01:28 2024 UTC