Skip to content

Parameter renaming amendments in ext/standard #6382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions ext/standard/basic_functions.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ function time_sleep_until(float $timestamp): bool {}

function get_current_user(): string {}

function get_cfg_var(string $name): string|array|false {}
function get_cfg_var(string $option): string|array|false {}

function error_log(string $message, int $message_type = 0, ?string $destination = null, ?string $additional_headers = null): bool {}

Expand All @@ -312,16 +312,16 @@ function php_strip_whitespace(string $filename): string {}

function highlight_string(string $string, bool $return = false): string|bool {}

function ini_get(string $name): string|false {}
function ini_get(string $option): string|false {}

function ini_get_all(?string $extension = null, bool $details = true): array|false {}

function ini_set(string $name, string $value): string|false {}
function ini_set(string $option, string $value): string|false {}

/** @alias ini_set */
function ini_alter(string $name, string $value): string|false {}
function ini_alter(string $option, string $value): string|false {}

function ini_restore(string $name): void {}
function ini_restore(string $option): void {}

function set_include_path(string $include_path): string|false {}

Expand Down Expand Up @@ -722,7 +722,7 @@ function rewinddir($dir_handle = null): void {}
function readdir($dir_handle = null): string|false {}

/** @param resource|null $context */
function scandir(string $directory, int $sorting_order = 0, $context = null): array|false {}
function scandir(string $directory, int $sorting_order = SCANDIR_SORT_ASCENDING, $context = null): array|false {}

#ifdef HAVE_GLOB
function glob(string $pattern, int $flags = 0): array|false {}
Expand Down Expand Up @@ -1110,7 +1110,7 @@ function dechex(int $num): string {}

function base_convert(string $num, int $from_base, int $to_base): string {}

function number_format(float $num, int $decimals = 0, ?string $decimal_separator = "." , ?string $thousands_separator = ","): string {}
function number_format(float $num, int $decimals = 0, ?string $decimal_separator = ".", ?string $thousands_separator = ","): string {}

function fmod(float $num1, float $num2): float {}

Expand All @@ -1125,7 +1125,7 @@ function gettimeofday(bool $as_float = false): array|float {}
#endif

#ifdef HAVE_GETRUSAGE
function getrusage(bool $mode = 0): array|false {}
function getrusage(int $mode = 0): array|false {}
#endif

/* pack.c */
Expand Down Expand Up @@ -1277,7 +1277,7 @@ function stream_socket_sendto($socket, string $data, int $flags = 0, string $add
* @param resource $stream
* @param resource|null $session_stream
*/
function stream_socket_enable_crypto($stream, bool $enable, ?int $crypto_type = null, $session_stream = null): int|bool {}
function stream_socket_enable_crypto($stream, bool $enable, ?int $crypto_method = null, $session_stream = null): int|bool {}

#ifdef HAVE_SHUTDOWN
/** @param resource $stream */
Expand Down Expand Up @@ -1439,8 +1439,7 @@ function rawurlencode(string $string): string {}
function rawurldecode(string $string): string {}

/** @param resource $context */
// TODO: Make bool argument?
function get_headers(string $url, int $as_assoc_array = 0, $context = null): array|false {}
function get_headers(string $url, bool $associative = false, $context = null): array|false {}

/* user_filters.c */

Expand Down
18 changes: 9 additions & 9 deletions ext/standard/basic_functions_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 146996b3110f85a6a2d074fb910f0d7aae573358 */
* Stub hash: e38af54610d415ef27b19137645d8f6481953624 */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0)
Expand Down Expand Up @@ -426,7 +426,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_current_user, 0, 0, IS_STRIN
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_get_cfg_var, 0, 1, MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_error_log, 0, 1, _IS_BOOL, 0)
Expand Down Expand Up @@ -477,7 +477,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_highlight_string, 0, 1, MAY_BE_S
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ini_get, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ini_get_all, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE)
Expand All @@ -486,14 +486,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ini_get_all, 0, 0, MAY_BE_ARRAY|
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ini_set, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0)
ZEND_END_ARG_INFO()

#define arginfo_ini_alter arginfo_ini_set

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ini_restore, 0, 1, IS_VOID, 0)
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_set_include_path, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
Expand Down Expand Up @@ -1125,7 +1125,7 @@ ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_scandir, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sorting_order, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sorting_order, IS_LONG, 0, "SCANDIR_SORT_ASCENDING")
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null")
ZEND_END_ARG_INFO()

Expand Down Expand Up @@ -1734,7 +1734,7 @@ ZEND_END_ARG_INFO()

#if defined(HAVE_GETRUSAGE)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_getrusage, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, _IS_BOOL, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
#endif

Expand Down Expand Up @@ -1931,7 +1931,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_socket_enable_crypto, 0, 2, MAY_BE_LONG|MAY_BE_BOOL)
ZEND_ARG_INFO(0, stream)
ZEND_ARG_TYPE_INFO(0, enable, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, crypto_type, IS_LONG, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, crypto_method, IS_LONG, 1, "null")
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, session_stream, "null")
ZEND_END_ARG_INFO()

Expand Down Expand Up @@ -2110,7 +2110,7 @@ ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_get_headers, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, url, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, as_assoc_array, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, associative, _IS_BOOL, 0, "false")
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null")
ZEND_END_ARG_INFO()

Expand Down
2 changes: 1 addition & 1 deletion ext/standard/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ PHP_FUNCTION(scandir)
{
char *dirn;
size_t dirn_len;
zend_long flags = 0;
zend_long flags = PHP_SCANDIR_SORT_ASCENDING;
zend_string **namelist;
int n, i;
zval *zcontext = NULL;
Expand Down
4 changes: 2 additions & 2 deletions ext/standard/url.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,14 +671,14 @@ PHP_FUNCTION(get_headers)
size_t url_len;
php_stream *stream;
zval *prev_val, *hdr = NULL;
zend_long format = 0;
zend_bool format = 0;
zval *zcontext = NULL;
php_stream_context *context;

ZEND_PARSE_PARAMETERS_START(1, 3)
Z_PARAM_PATH(url, url_len)
Z_PARAM_OPTIONAL
Z_PARAM_LONG(format)
Z_PARAM_BOOL(format)
Z_PARAM_RESOURCE_OR_NULL(zcontext)
ZEND_PARSE_PARAMETERS_END();

Expand Down