1--TEST--
2Bug #78662 (stream_write bad error detection)
3--FILE--
4<?php
5class FailedStream {
6    public $context;
7    function stream_open($path, $mode, $options, &$opened_path)
8    {
9        return true;
10    }
11    function stream_read($count)
12    {
13        return false;
14    }
15    function stream_write($data)
16    {
17        return false;
18    }
19    function stream_stat()
20    {
21        return [];
22    }
23}
24stream_wrapper_register('fails', 'FailedStream');
25$f=fopen('fails://foo', 'a+');
26var_dump(fwrite($f, "bar"));
27var_dump(fread($f, 100));
28?>
29Done
30--EXPECT--
31bool(false)
32bool(false)
33Done
34