#21730 [NEW]: *scanf "%n" conversion flag gives string instead of integer
| From: | moriyoshi@php.net | Date: | Sat, 18 Jan 2003 18:28:28 +0000 |
| Subject: | #21730 [NEW]: *scanf "%n" conversion flag gives string instead of integer | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-30494@lists.php.net to get a copy of this message | ||
From: moriyoshi@php.net
Operating system: Any
PHP version: 5CVS-2003-01-18 (dev)
PHP Bug Type: Strings related
Bug description: *scanf "%n" conversion flag gives string instead of integer
Try the following script:
<?php
$foo = "ABC = DEF";
$fmt = "%s = %s %n";
$res_a = array();
/* $res_a[2] is supposed to be a integer value that
* represents the number of characters consumed so far
*/
sscanf($foo, $fmt, $res_a[0], $res_a[1], $res_a[2]);
$res_b = sscanf($foo, $fmt);
var_dump($res_a);
var_dump($res_b);
?>
--
Edit bug report at http://bugs.php.net/?id=21730&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=21730&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=21730&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=21730&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=21730&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=21730&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=21730&r=support
Expected behavior: http://bugs.php.net/fix.php?id=21730&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=21730&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=21730&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=21730&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21730&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=21730&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=21730&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=21730&r=gnused