1--TEST--
2Bug #75031: Append mode in php://temp and php://memory
3--FILE--
4<?php
5
6function test_75031($type, $mode) {
7    $fp = fopen($type, $mode);
8    fwrite($fp, "hello");
9    fseek($fp, 0, SEEK_SET);
10    fwrite($fp, "world");
11    var_dump(stream_get_contents($fp, -1, 0));
12    fclose($fp);
13}
14
15test_75031("php://temp", "w+");
16test_75031("php://memory", "w+");
17test_75031("php://temp", "a+");
18test_75031("php://memory", "a+");
19
20?>
21--EXPECT--
22string(5) "world"
23string(5) "world"
24string(10) "helloworld"
25string(10) "helloworld"
26