Doc #54287 [Opn->Bgs]: Notation of the placeholders seems wrong

From: Date: Thu, 17 Mar 2011 07:21:35 +0000
Subject: Doc #54287 [Opn->Bgs]: Notation of the placeholders seems wrong
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-6097@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 Updated by: aharvey@php.net Reported by: accounts at rgloyer dot de Summary: Notation of the placeholders seems wrong -Status: Open +Status: Bogus Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant Block user comment: N Private report: N New Comment: The examples are (intentionally) incomplete: if you define $num and $location, you won't get the warnings. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.doc.bugs (#6097) next »