Annotation of embedaddon/php/ext/standard/tests/strings/bug21730.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #21730 (*scanf "%n" conversion flag gives string instead of integer)
3: --FILE--
4: <?php
5: $foo = "ABC = DEF";
6: $fmt = "%s = %s %n";
7: $res_a = array();
8:
9: /* $res_a[2] is supposed to be a integer value that
10: * represents the number of characters consumed so far
11: */
12: sscanf($foo, $fmt, $res_a[0], $res_a[1], $res_a[2]);
13:
14: $res_b = sscanf($foo, $fmt);
15:
16: var_dump($res_a);
17: var_dump($res_b);
18: ?>
19: --EXPECT--
20: array(3) {
21: [0]=>
22: string(3) "ABC"
23: [1]=>
24: string(3) "DEF"
25: [2]=>
26: int(9)
27: }
28: array(3) {
29: [0]=>
30: string(3) "ABC"
31: [1]=>
32: string(3) "DEF"
33: [2]=>
34: int(9)
35: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>