#26878 [Ver->Csd]: *printf argument swapping
| From: | iliaa@php.net | Date: | Tue, 13 Jan 2004 23:26:39 +0000 |
| Subject: | #26878 [Ver->Csd]: *printf argument swapping | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-53280@lists.php.net to get a copy of this message | ||
ID: 26878
Updated by: iliaa@php.net
Reported By: drm at melp dot nl
-Status: Verified
+Status: Closed
Bug Type: Strings related
Operating System: *
PHP Version: 4CVS, 5CVS
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2004-01-12 07:42:29] drm at melp dot nl
Description:
------------
The *printf family has a bug when pointing to the same argument with
different types. Probably the same memoryaddress is used for casting
when formatting the argument.
Reproduce code:
---------------
printf (
'Int: %1$d and as string: %1$s',
'some string'
);
// Note that the same happens when
// using any of the other printf
// functions
Expected result:
----------------
Int: 0 and as string: some string
Actual result:
--------------
Int: 0 and as string: 0
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26878&edit=1