diff options
author | Wez Furlong <wez@php.net> | 2002-12-22 18:06:27 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2002-12-22 18:06:27 +0000 |
commit | c5091eedf10cfbc66dab9b2d81e99bd474808297 (patch) | |
tree | 32e178fe334890a0761ee1e6b555b5defa1f429f | |
parent | efea12fec5078c4a168e4f85e80ec71d1b764c23 (diff) | |
download | php-git-c5091eedf10cfbc66dab9b2d81e99bd474808297.tar.gz |
Forgot to include this in my previous commit for #21131 fix.
-rw-r--r-- | ext/standard/tests/file/bug21131.phpt | 23 |
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 + |