Doc #54287 [Com]: Notation of the placeholders seems wrong
| From: | carsten_sttgt at gmx dot de | Date: | Thu, 17 Mar 2011 08:14:26 +0000 |
| Subject: | Doc #54287 [Com]: Notation of the placeholders seems wrong | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-6099@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=54287&edit=1
ID: 54287
Comment by: carsten_sttgt at gmx dot de
Reported by: accounts at rgloyer dot de
Summary: Notation of the placeholders seems wrong
Status: Bogus
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
@aharvey
> The examples are (intentionally) incomplete:
What's the sense of a /intentionally/ incomplete example?
In my opinion it's just a wrong example and thus a documentation
problem.
Previous Comments:
------------------------------------------------------------------------
[2011-03-17 08:21:32] aharvey@php.net
The examples are (intentionally) incomplete: if you define $num and
$location, you won't get the warnings.
------------------------------------------------------------------------
[2011-03-17 08:03:26] accounts at rgloyer dot de
Description:
------------
---
From manual page: http://www.php.net/function.sprintf#Parameters
---
From the manual page:
Example #3 Argument swapping
<?php
$format = 'The %2$s contains %1$d monkeys';
printf($format, $num, $location);
?>
This doesn't work. I get the error: undefined variable
It works if i write: %2\$s and %1\$d
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54287&edit=1