summaryrefslogtreecommitdiff
path: root/ext/standard/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/file.c')
-rw-r--r--ext/standard/file.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c
index e99be2e0c6..6b5c9a30ba 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -763,7 +763,11 @@ PHPAPI PHP_FUNCTION(fclose)
}
php_stream_from_zval(stream, arg1);
- zend_list_delete(stream->rsrc_id);
+ if (!stream->is_persistent) {
+ zend_list_delete(stream->rsrc_id);
+ } else {
+ php_stream_pclose(stream);
+ }
RETURN_TRUE;
}