#21730 [Opn->Csd]: *scanf "%n" conversion flag gives string instead of integer

From: Date: Sat, 18 Jan 2003 18:33:04 +0000
Subject: #21730 [Opn->Csd]: *scanf "%n" conversion flag gives string instead of integer
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-30496@lists.php.net to get a copy of this message
ID: 21730 Updated by: moriyoshi@php.net Reported By: moriyoshi@php.net -Status: Open +Status: Closed Bug Type: Strings related Operating System: Any PHP Version: 5CVS-2003-01-18 (dev) Assigned To: moriyoshi New Comment: This bug has been fixed in CVS. In case this was a PHP problem, 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/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2003-01-18 12:28:28] moriyoshi@php.net 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 this bug report at http://bugs.php.net/?id=21730&edit=1

« previous php.bugs (#30496) next »