mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
ext/standard/file: clarify fclose() warning
This commit is contained in:
parent
556e4d9008
commit
fec4f7f389
4 changed files with 5 additions and 5 deletions
|
@ -10,6 +10,6 @@ var_dump($obj->fgets());
|
|||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: fclose(): %d is not a valid stream resource in %s on line %d
|
||||
Warning: fclose(): cannot close the provided stream, as it must not be manually closed in %s on line %d
|
||||
string(6) "<?php
|
||||
"
|
||||
|
|
|
@ -757,7 +757,7 @@ PHPAPI PHP_FUNCTION(fclose)
|
|||
ZEND_PARSE_PARAMETERS_END();
|
||||
|
||||
if ((stream->flags & PHP_STREAM_FLAG_NO_FCLOSE) != 0) {
|
||||
php_error_docref(NULL, E_WARNING, ZEND_LONG_FMT " is not a valid stream resource", stream->res->handle);
|
||||
php_error_docref(NULL, E_WARNING, "cannot close the provided stream, as it must not be manually closed");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,5 +22,5 @@ fwrite($fd, "foo");
|
|||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: fclose(): %d is not a valid stream resource in %s on line %d
|
||||
Warning: fclose(): cannot close the provided stream, as it must not be manually closed in %s on line %d
|
||||
fclose(): Argument #1 ($stream) must be an open stream resource
|
||||
|
|
|
@ -26,7 +26,7 @@ okey
|
|||
@unlink("bug79029_3.txt");
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: fclose(): %d is not a valid stream resource in %sbug79029.php on line %d
|
||||
Warning: fclose(): cannot close the provided stream, as it must not be manually closed in %sbug79029.php on line %d
|
||||
|
||||
Warning: fclose(): %d is not a valid stream resource in %sbug79029.php on line %d
|
||||
Warning: fclose(): cannot close the provided stream, as it must not be manually closed in %sbug79029.php on line %d
|
||||
okey
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue