]> granicus.if.org Git - php/commitdiff
This commit was manufactured by cvs2svn to create branch 'PHP_4_3'.
authorSVN Migration <svn@php.net>
Sat, 18 Jan 2003 19:02:22 +0000 (19:02 +0000)
committerSVN Migration <svn@php.net>
Sat, 18 Jan 2003 19:02:22 +0000 (19:02 +0000)
ext/standard/tests/image/test1pix.jp2 [new file with mode: 0644]
ext/standard/tests/strings/bug21730.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/image/test1pix.jp2 b/ext/standard/tests/image/test1pix.jp2
new file mode 100644 (file)
index 0000000..8a1172e
Binary files /dev/null and b/ext/standard/tests/image/test1pix.jp2 differ
diff --git a/ext/standard/tests/strings/bug21730.phpt b/ext/standard/tests/strings/bug21730.phpt
new file mode 100644 (file)
index 0000000..8d40e20
--- /dev/null
@@ -0,0 +1,35 @@
+--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);
+?>
+--EXPECT--
+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)
+}