Req #69751 [NEW]: Change Error message of sprintf/printf for missing/typo position specifier

From: Date: Wed, 03 Jun 2015 11:59:15 +0000
Subject: Req #69751 [NEW]: Change Error message of sprintf/printf for missing/typo position specifier
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193085@lists.php.net to get a copy of this message
From: Hoffmann dot P at gmx dot net Operating system: Linux 3.13.0-53-generic PHP version: 5.5.25 Package: SPL related Bug Type: Feature/Change Request Bug description:Change Error message of sprintf/printf for missing/typo position specifier Description: ------------ I suggest a more comprehensible error message (see suggestion in "Expected result"). The current error message was missunderstood by me as "The number of arguments of the function is zero (and must be greater than zero)". Instead it was the number of the position specifier argument that was missing (type, "$" and "1" where reversed). Test script: --------------- sprintf("%$1s, %2$s %1$s", "Sir", "Yes"); Expected result: ---------------- Missing position specifier number in /home/ber/Code/Kompetenztest/org/ValiditätEingabe/class_test.php on line $line Actual result: -------------- Argument number must be greater than zero in /home/ber/Code/Kompetenztest/org/ValiditätEingabe/class_test.php on line $line -- Edit bug report at https://bugs.php.net/bug.php?id=69751&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69751&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69751&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69751&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69751&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69751&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69751&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69751&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69751&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69751&r=support Expected behavior: https://bugs.php.net/fix.php?id=69751&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69751&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69751&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69751&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69751&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69751&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69751&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69751&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69751&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69751&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69751&r=mysqlcfg

« previous php.bugs (#193085) next »