#32617 [Bgs]: Argument swapping example contains bogus slashes
| From: | tommy at apt dot no | Date: | Thu, 07 Apr 2005 08:11:30 +0000 |
| Subject: | #32617 [Bgs]: Argument swapping example contains bogus slashes | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969367769@lists.php.net to get a copy of this message | ||
ID: 32617
User updated by: tommy at apt dot no
Reported By: tommy at apt dot no
Status: Bogus
Bug Type: Documentation problem
PHP Version: Irrelevant
New Comment:
Sorry, my mistake.
When using " as string delimiter, they should obviously be there, as in
the example. But, if using ' as string delimiter, they shouldn't be
there, but this isn't really relevant for the example.
Previous Comments:
------------------------------------------------------------------------
[2005-04-07 10:03:09] dmytton@php.net
This is not a bug. The slashes are required because you have the
integer specifying the order in front of the $.
------------------------------------------------------------------------
[2005-04-07 09:45:27] tommy at apt dot no
Description:
------------
http://se.php.net/sprintf#AEN144043
The slashes infront of the $ shouldn't as far as I can see, be there:
Example 3. Argument swapping
<?php
$format = "The %2\$s contains %1\$d monkeys";
printf($format, $num, $location);
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32617&edit=1