summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSVN Migration <svn@php.net>2002-12-22 18:06:28 +0000
committerSVN Migration <svn@php.net>2002-12-22 18:06:28 +0000
commit41226129d7ede38ddaae47c157c20b8280eac6fb (patch)
tree31f5e722ce2769b34a5e25283f5652611fc5bbcc
parent17384705d3be9cc92867ce0f8d9ef02805a2f830 (diff)
downloadphp-git-41226129d7ede38ddaae47c157c20b8280eac6fb.tar.gz
This commit was manufactured by cvs2svn to create branch 'PHP_4_3'.
-rw-r--r--ext/standard/tests/file/bug21131.phpt23
1 files changed, 23 insertions, 0 deletions
diff --git a/ext/standard/tests/file/bug21131.phpt b/ext/standard/tests/file/bug21131.phpt
new file mode 100644
index 0000000000..00c3781f9c
--- /dev/null
+++ b/ext/standard/tests/file/bug21131.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #21131: fopen($filename, "a+") has broken position
+--FILE--
+<?php # vim600:syn=php:
+$filename = tempnam("/tmp", "phpt");
+
+$fp = fopen($filename, "w") or die("can't open $filename for append");
+fwrite($fp, "foobar");
+fclose($fp);
+
+$fp = fopen($filename, "a+");
+var_dump(ftell($fp));
+rewind($fp);
+var_dump(ftell($fp));
+fpassthru($fp);
+fclose($fp);
+unlink($filename);
+?>
+--EXPECT--
+int(6)
+int(0)
+foobar
+