long flags = ((argc < 3) && UG(unicode)) ? PHP_FILE_TEXT : 0;
zval *zcontext = NULL;
php_stream_context *context = NULL;
+ char mode[3] = { 'w', 0, 0 };
php_stream *srcstream = NULL;
- char mode[3] = "wb";
if (zend_parse_parameters(argc TSRMLS_CC, "Zz/|lr!", &ppfilename, &data, &flags, &zcontext) == FAILURE) {
return;
RETURN_FALSE;
}
- if (mode[0] = 'c') {
- php_stream_truncate_set_size(stream, 0);
- }
-
switch (Z_TYPE_P(data)) {
case IS_RESOURCE:
numchars = php_stream_copy_to_stream(srcstream, stream, PHP_STREAM_COPY_ALL);