php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42107 sscanf broken when using %2$s type format parameters
Submitted: 2007-07-26 00:54 UTC Modified: 2007-07-26 15:24 UTC
From: mike at theupstairsroom dot com Assigned: jani
Status: Closed Package: Strings related
PHP Version: 5.2.3 OS: CentOS
Private report: No CVE-ID:
 [2007-07-26 00:54 UTC] mike at theupstairsroom dot com
Description:
------------
Unexpected results returned when using positioned parameters in sscanf()

Reproduce code:
---------------
$test = sscanf('test string', '%2$s %1$s');
print_r($test);

Expected result:
----------------
array(
   [0] => 'string',
   [1] => 'test'
)

Actual result:
--------------
Array
(
    [0] => 
    [1] => 
    [3] => test
    [2] => string
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-26 14:27 UTC] jani@php.net
Fix prepared. Running test now..
 [2007-07-26 15:24 UTC] jani@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 08:02:33 2014 UTC