If there was an error, the number of bytes written will be less than count.
php_stream_write() returns the number of bytes that were read successfully. If there was an error, the number of bytes written will be less than count.