From: RQuadling at GMail dot com Operating system: Windows XP PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: [chm] bug on function.sprintf.html
Description: ------------ I have found a bug on page function.sprintf.html [chm date: 2006-04-03]... The examples regarding the facility of argument swapping all use double quotes. As a consequence, the parameters need to escape the $ in the format so to tell PHP to not evaluate $s. e.g. "%1\$s" As the basic idea here is to use these markers as placeholders for data from elsewhere, the emphasis is surely that these are plaintext strings, not strings with embedded variables, otherwise, what's the point of the function? Yeah, I know formatting, but you can't format a variable if you supply it IN the string, so hopefully, my reasoning still stands. The examples should be ... '%1$s' This makes more sense. All the examples and a lot of the user notes ALL use the 'suspect' double quotes. The user note by moritz dot geselle at invision-team dot de on 02-Dec-2002 10:52 (http://uk2.php.net/manual/en/function.sprintf.php#27346) should be taken into account and the docs reflect this simply because it is NOT obvious! -- Edit bug report at http://bugs.php.net/?id=36980&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36980&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36980&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36980&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36980&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36980&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36980&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=36980&r=needscript Try newer version: http://bugs.php.net/fix.php?id=36980&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36980&r=support Expected behavior: http://bugs.php.net/fix.php?id=36980&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36980&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36980&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36980&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36980&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36980&r=dst IIS Stability: http://bugs.php.net/fix.php?id=36980&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36980&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36980&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36980&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=36980&r=mysqlcfg