cvs: php4(PHP_4_3) /ext/standard/tests/strings bug21730.phpt
| From: | Moriyoshi Koizumi | Date: | Sat, 18 Jan 2003 21:21:33 +0000 |
| Subject: | cvs: php4(PHP_4_3) /ext/standard/tests/strings bug21730.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-18027@lists.php.net to get a copy of this message | ||
moriyoshi Sat Jan 18 16:21:33 2003 EDT
Added files: (Branch: PHP_4_3)
/php4/ext/standard/tests/strings bug21730.phpt
Log:
MFH: added test case for bug #21730
Index: php4/ext/standard/tests/strings/bug21730.phpt
+++ php4/ext/standard/tests/strings/bug21730.phpt
--TEST--
Bug #21730 (*scanf "%n" conversion flag gives string instead of integer)
--FILE--
<?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);
?>
--EXPECTS--
array(3) {
[0]=>
string(3) "ABC"
[1]=>
string(3) "DEF"
[2]=>
int(9)
}
array(3) {
[0]=>
string(3) "ABC"
[1]=>
string(3) "DEF"
[2]=>
int(9)
}