Req #69751 [Opn]: Change Error message of sprintf/printf for missing/typo position specifier
| From: | cmb@php.net | Date: | Thu, 04 Jun 2015 12:04:54 +0000 |
| Subject: | Req #69751 [Opn]: Change Error message of sprintf/printf for missing/typo position specifier | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-193113@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69751&edit=1
ID: 69751
Updated by: cmb@php.net
Reported by: Hoffmann dot P at gmx dot net
Summary: Change Error message of sprintf/printf for
missing/typo position specifier
Status: Open
Type: Feature/Change Request
-Package: SPL related
+Package: Strings related
Operating System: Linux 3.13.0-53-generic
PHP Version: 5.5.25
Block user comment: N
Private report: N
New Comment:
See <http://3v4l.org/CPIng> for a corrected test script.
Previous Comments:
------------------------------------------------------------------------
[2015-06-03 11:59:13] Hoffmann dot P at gmx dot net
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 this bug report at https://bugs.php.net/bug.php?id=69751&edit=1