|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12663 %s 'string notator' only grabs a single word, not an entire string.
Submitted: 2001-08-08 17:43 UTC Modified: 2002-01-08 21:01 UTC
From: vallimar at sexorcisto dot net Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.0.6 OS: Redhat 7.1 kernel 2.4.7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: vallimar at sexorcisto dot net
New email:
PHP Version: OS:


 [2001-08-08 17:43 UTC] vallimar at sexorcisto dot net
    $bug = "this_is = a bug";
    list($var1, $var2) = sscanf($bug, "%s = %s");
    echo "Var1: $var1,  Var2: $var2\n";

Execute and you will see that it does not check on strings
and any spaces will foul the results which is not good.

Which means it is only checking at the word level, and
stopping once it hits a space, instead of parsing the
entirety as a string which is what it should be doing.

I have had to switch to using explode() which is problematic
because I may have more then 1 '=' sign in the string and I
only want to split on the first one.

Please get this fixed as it causes problems, headaches and
the need to write crappily inefficent workarounds when a
simple sscanf is all you should need.


Modules.. Hmm, I have no idea really, I installed the RPM.
Goto  for the php configuration
output if you need it.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-09 21:50 UTC] vallimar at sexorcisto dot net
Ugh, they have filtered incoming port 80..
to see the configuration.
 [2002-01-08 21:01 UTC]
From the man page for sscanf:

s - Matches a sequence of non-white-space characters;

This is by design, not a bug.

 [2002-01-08 21:01 UTC]
Forgot to close.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 16 02:01:29 2024 UTC