From: Nikita Popov Date: Thu, 9 Apr 2020 14:21:48 +0000 (+0200) Subject: Mark fgets() argument as UNKNOWN X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=636c827aa2f72deb6d4f431a95b39a182b32dbeb;p=php Mark fgets() argument as UNKNOWN If no value is passed, this reads as much as necessary, not 1024 bytes. --- diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index e3f6e4146e..067797111c 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -801,7 +801,7 @@ function feof($handle): bool {} function fgetc($handle): string|false {} /** @param resource $handle */ -function fgets($handle, int $length = 1024): string|false {} +function fgets($handle, int $length = UNKNOWN): string|false {} /** @param resource $handle */ function fread($handle, int $length): string|false {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 73fab38357..8fb731f912 100755 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -1229,7 +1229,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fgets, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_INFO(0, handle) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "1024") + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fread, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)