Skip to content

Commit 636c827

Browse files
committed
Mark fgets() argument as UNKNOWN
If no value is passed, this reads as much as necessary, not 1024 bytes.
1 parent 62e8dcb commit 636c827

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/standard/basic_functions.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ function feof($handle): bool {}
801801
function fgetc($handle): string|false {}
802802

803803
/** @param resource $handle */
804-
function fgets($handle, int $length = 1024): string|false {}
804+
function fgets($handle, int $length = UNKNOWN): string|false {}
805805

806806
/** @param resource $handle */
807807
function fread($handle, int $length): string|false {}

ext/standard/basic_functions_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ ZEND_END_ARG_INFO()
12291229

12301230
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fgets, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
12311231
ZEND_ARG_INFO(0, handle)
1232-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "1024")
1232+
ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0)
12331233
ZEND_END_ARG_INFO()
12341234

12351235
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fread, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)

0 commit comments

Comments
 (0)