[phpstorm-stubs] fix default values according to reflection

This commit is contained in:
Ivan Fedorov 2021-12-09 19:35:12 +01:00 committed by Ivan Fedorov
parent 3cbaa7eb27
commit af045dfb25
35 changed files with 353 additions and 322 deletions

View File

@ -13,7 +13,7 @@ use JetBrains\PhpStorm\Pure;
* @param string $num2 <p>
* The right operand, as a string.
* </p>
* @param int|null $scale [optional] <p>
* @param int|null $scale <p>
* This optional parameter is used to set the number of digits after the
* decimal place in the result. If omitted, it will default to the scale
* set globally with the {@link bcscale()} function, or fallback to 0 if
@ -22,7 +22,7 @@ use JetBrains\PhpStorm\Pure;
* @return string The sum of the two operands, as a string.
*/
#[Pure]
function bcadd(string $num1, string $num2, ?int $scale = 0): string {}
function bcadd(string $num1, string $num2, ?int $scale = null): string {}
/**
* Subtract one arbitrary precision number from another
@ -33,7 +33,7 @@ function bcadd(string $num1, string $num2, ?int $scale = 0): string {}
* @param string $num2 <p>
* The right operand, as a string.
* </p>
* @param int|null $scale [optional] <p>
* @param int|null $scale <p>
* This optional parameter is used to set the number of digits after the
* decimal place in the result. If omitted, it will default to the scale
* set globally with the {@link bcscale()} function, or fallback to 0 if
@ -42,7 +42,7 @@ function bcadd(string $num1, string $num2, ?int $scale = 0): string {}
* @return string The result of the subtraction, as a string.
*/
#[Pure]
function bcsub(string $num1, string $num2, ?int $scale = 0): string {}
function bcsub(string $num1, string $num2, ?int $scale = null): string {}
/**
* Multiply two arbitrary precision numbers
@ -53,7 +53,7 @@ function bcsub(string $num1, string $num2, ?int $scale = 0): string {}
* @param string $num2 <p>
* The right operand, as a string.
* </p>
* @param int|null $scale [optional] <p>
* @param int|null $scale <p>
* This optional parameter is used to set the number of digits after the
* decimal place in the result. If omitted, it will default to the scale
* set globally with the {@link bcscale()} function, or fallback to 0 if
@ -62,7 +62,7 @@ function bcsub(string $num1, string $num2, ?int $scale = 0): string {}
* @return string the result as a string.
*/
#[Pure]
function bcmul(string $num1, string $num2, ?int $scale = 0): string {}
function bcmul(string $num1, string $num2, ?int $scale = null): string {}
/**
* Divide two arbitrary precision numbers
@ -163,7 +163,7 @@ function bcmod(string $num1, string $num2, ?int $scale = 0): string {}
* The valid range of the exponent is platform specific, but is at least
* -2147483648 to 2147483647.
* </p>
* @param int|null $scale [optional] <p>
* @param int|null $scale <p>
* This optional parameter is used to set the number of digits after the
* decimal place in the result. If omitted, it will default to the scale
* set globally with the {@link bcscale()} function, or fallback to 0 if
@ -172,7 +172,7 @@ function bcmod(string $num1, string $num2, ?int $scale = 0): string {}
* @return string the result as a string.
*/
#[Pure]
function bcpow(string $num, string $exponent, ?int $scale = 0): string {}
function bcpow(string $num, string $exponent, ?int $scale = null): string {}
/**
* Get the square root of an arbitrary precision number
@ -209,7 +209,7 @@ function bcscale(
* @param string $num2 <p>
* The right operand, as a string.
* </p>
* @param int|null $scale [optional] <p>
* @param int|null $scale <p>
* The optional <i>scale</i> parameter is used to set the
* number of digits after the decimal place which will be used in the
* comparison.
@ -234,7 +234,7 @@ function bccomp(string $num1, string $num2, ?int $scale = null): int {}
* @param string $modulus <p>
* The modulus, as an integral string (i.e. the scale has to be zero).
* </p>
* @param int|null $scale [optional] <p>
* @param int|null $scale <p>
* This optional parameter is used to set the number of digits after the
* decimal place in the result. If omitted, it will default to the scale
* set globally with the {@link bcscale()} function, or fallback to 0 if
@ -245,4 +245,4 @@ function bccomp(string $num1, string $num2, ?int $scale = null): int {}
*/
#[Pure]
#[LanguageLevelTypeAware(["8.0" => "string"], default: "?string")]
function bcpowmod(string $num, string $exponent, string $modulus, ?int $scale = 0) {}
function bcpowmod(string $num, string $exponent, string $modulus, ?int $scale = null) {}

View File

@ -191,12 +191,12 @@ function easter_days(?int $year, int $mode = CAL_EASTER_DEFAULT): int {}
/**
* Convert Unix timestamp to Julian Day
* @link https://php.net/manual/en/function.unixtojd.php
* @param int|null $timestamp [optional] defaults to time() <p>
* @param int|null $timestamp defaults to time() <p>
* A unix timestamp to convert.
* </p>
* @return int|false A julian day number as integer.
*/
function unixtojd(?int $timestamp = 0): int|false {}
function unixtojd(?int $timestamp = null): int|false {}
/**
* Convert Julian Day to Unix timestamp

View File

@ -2572,14 +2572,14 @@ function curl_escape(#[LanguageLevelTypeAware(['8.0' => 'CurlHandle'], default:
* Create a CURLFile object
* @link https://secure.php.net/manual/en/curlfile.construct.php
* @param string $filename <p> Path to the file which will be uploaded.</p>
* @param string|null $mime_type [optional] <p>Mimetype of the file.</p>
* @param string|null $posted_filename [optional] <p>Name of the file.</p>
* @param string|null $mime_type <p>Mimetype of the file.</p>
* @param string|null $posted_filename <p>Name of the file.</p>
* @return CURLFile
* Returns a {@link https://secure.php.net/manual/en/class.curlfile.php CURLFile} object.
* @since 5.5
*/
#[Pure]
function curl_file_create(string $filename, ?string $mime_type = '', ?string $posted_filename = ''): CURLFile {}
function curl_file_create(string $filename, ?string $mime_type = null, ?string $posted_filename = null): CURLFile {}
/**
* Close a cURL session

View File

@ -90,7 +90,7 @@ class finfo
* (PHP &gt;= 5.3.0, PECL fileinfo &gt;= 0.1.0)<br/>
* Create a new fileinfo resource
* @link https://php.net/manual/en/function.finfo-open.php
* @param int $flags [optional] <p>
* @param int $flags <p>
* One or disjunction of more Fileinfo
* constants.
* </p>
@ -105,7 +105,7 @@ class finfo
* @return resource|false a magic database resource on success or <b>FALSE</b> on failure.
*/
#[LanguageLevelTypeAware(['8.1' => 'finfo|false'], default: 'resource|false')]
function finfo_open(int $flags, ?string $magic_database = null) {}
function finfo_open(int $flags = 0, ?string $magic_database = null) {}
/**
* (PHP &gt;= 5.3.0, PECL fileinfo &gt;= 0.1.0)<br/>
@ -143,7 +143,7 @@ function finfo_set_flags(#[LanguageLevelTypeAware(['8.1' => 'finfo'], default: '
* @param string $filename <p>
* Name of a file to be checked.
* </p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* One or disjunction of more Fileinfo
* constants.
* </p>
@ -153,7 +153,7 @@ function finfo_set_flags(#[LanguageLevelTypeAware(['8.1' => 'finfo'], default: '
* @return string|false a textual description of the contents of the
* <i>filename</i> argument, or <b>FALSE</b> if an error occurred.
*/
function finfo_file(#[LanguageLevelTypeAware(['8.1' => 'finfo'], default: 'resource')] $finfo, string $filename, int $flags, $context): string|false {}
function finfo_file(#[LanguageLevelTypeAware(['8.1' => 'finfo'], default: 'resource')] $finfo, string $filename, int $flags = 0, $context): string|false {}
/**
* (PHP 5 &gt;= 5.3.0, PECL fileinfo &gt;= 0.1.0)<br/>

View File

@ -18,7 +18,7 @@ use JetBrains\PhpStorm\Pure;
* The ID of the filter to apply. The
* manual page lists the available filters.
* </p>
* @param array|int $options [optional] <p>
* @param array|int $options <p>
* Associative array of options or bitwise disjunction of flags. If filter
* accepts options, flags can be provided in "flags" field of array.
* </p>
@ -28,7 +28,7 @@ use JetBrains\PhpStorm\Pure;
* returns <b>FALSE</b> if the variable is not set and <b>NULL</b> if the filter fails.
*/
#[Pure]
function filter_input(int $type, string $var_name, int $filter = FILTER_DEFAULT, array|int $options): mixed {}
function filter_input(int $type, string $var_name, int $filter = FILTER_DEFAULT, array|int $options = 0): mixed {}
/**
* Filters a variable with a specified filter
@ -40,7 +40,7 @@ function filter_input(int $type, string $var_name, int $filter = FILTER_DEFAULT,
* The ID of the filter to apply. The
* manual page lists the available filters.
* </p>
* @param array|int $options [optional] <p>
* @param array|int $options <p>
* Associative array of options or bitwise disjunction of flags. If filter
* accepts options, flags can be provided in "flags" field of array. For
* the "callback" filter, callable type should be passed. The
@ -84,7 +84,7 @@ function filter_input(int $type, string $var_name, int $filter = FILTER_DEFAULT,
* @return mixed the filtered data, or <b>FALSE</b> if the filter fails.
*/
#[Pure]
function filter_var(mixed $value, int $filter = FILTER_DEFAULT, array|int $options): mixed {}
function filter_var(mixed $value, int $filter = FILTER_DEFAULT, array|int $options = 0): mixed {}
/**
* Gets external variables and optionally filters them

View File

@ -2191,13 +2191,13 @@ function imageconvolution(GdImage $image, array $matrix, float $divisor, float $
/**
* @param resource|GdImage $image An image resource, returned by one of the image creation functions, such as {@see imagecreatetruecolor()}.
* @param int|null $resolution_x [optional] The horizontal resolution in DPI.
* @param int|null $resolution_y [optional] The vertical resolution in DPI.
* @param int|null $resolution_x The horizontal resolution in DPI.
* @param int|null $resolution_y The vertical resolution in DPI.
* @return array|bool When used as getter (that is without the optional parameters), it returns <b>TRUE</b> on success, or <b>FALSE</b> on failure. When used as setter (that is with one or both optional parameters given), it returns an indexed array of the horizontal and vertical resolution on success, or <b>FALSE</b> on failure.
* @link https://php.net/manual/en/function.imageresolution.php
* @since 7.2
*/
function imageresolution(GdImage $image, ?int $resolution_x = 96, ?int $resolution_y = 96): array|bool {}
function imageresolution(GdImage $image, ?int $resolution_x = null, ?int $resolution_y = null): array|bool {}
/**
* <b>imagesetclip()</b> sets the current clipping rectangle, i.e. the area beyond which no pixels will be drawn.

View File

@ -25,7 +25,7 @@ use JetBrains\PhpStorm\Pure;
* binary representation of the message digest is returned.
*/
#[Pure]
function hash(string $algo, string $data, bool $binary = false, #[PhpStormStubsElementAvailable('8.1')] array $options = null): string|false {}
function hash(string $algo, string $data, bool $binary = false, #[PhpStormStubsElementAvailable('8.1')] array $options = []): string|false {}
/**
* Timing attack safe string comparison
@ -57,7 +57,7 @@ function hash_equals(string $known_string, string $user_string): bool {}
* binary representation of the message digest is returned.
*/
#[Pure]
function hash_file(string $algo, string $filename, bool $binary = false, #[PhpStormStubsElementAvailable('8.1')] array $options = null): string|false {}
function hash_file(string $algo, string $filename, bool $binary = false, #[PhpStormStubsElementAvailable('8.1')] array $options = []): string|false {}
/**
* (PHP 5 &gt;= 5.1.2, PECL hash &gt;= 1.1)<br/>
@ -122,7 +122,7 @@ function hash_hmac_file(string $algo, string $data, string $key, bool $binary =
* <b>HASH_HMAC</b>. When specified, the <i>key</i>
* must be specified.
* </p>
* @param string $key [optional] <p>
* @param string $key <p>
* When <b>HASH_HMAC</b> is specified for <i>options</i>,
* a shared secret key to be used with the HMAC hashing method must be supplied in this
* parameter.
@ -133,7 +133,7 @@ function hash_hmac_file(string $algo, string $data, string $key, bool $binary =
*/
#[Pure]
#[LanguageLevelTypeAware(["7.2" => "HashContext"], default: "resource")]
function hash_init(string $algo, int $flags = 0, string $key, #[PhpStormStubsElementAvailable('8.1')] array $options = null) {}
function hash_init(string $algo, int $flags = 0, string $key = "", #[PhpStormStubsElementAvailable('8.1')] array $options = []) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL hash &gt;= 1.1)<br/>

View File

@ -84,7 +84,7 @@ function iconv_set_encoding(string $type, string $encoding): bool {}
* @param string $string <p>
* The string.
* </p>
* @param string|null $encoding [optional] <p>
* @param string|null $encoding <p>
* If <i>charset</i> parameter is omitted,
* <i>str</i> is assumed to be encoded in
* iconv.internal_encoding.
@ -92,7 +92,7 @@ function iconv_set_encoding(string $type, string $encoding): bool {}
* @return int|false the character count of <i>str</i>, as an integer. False on error.
*/
#[Pure]
function iconv_strlen(string $string, ?string $encoding = 'ini_get("iconv.internal_encoding")'): int|false {}
function iconv_strlen(string $string, ?string $encoding = null): int|false {}
/**
* Cut out part of a string
@ -127,7 +127,7 @@ function iconv_strlen(string $string, ?string $encoding = 'ini_get("iconv.intern
* In case <i>offset</i> is also negative, the start position
* is calculated beforehand according to the rule explained above.
* </p>
* @param string|null $encoding [optional] <p>
* @param string|null $encoding <p>
* If <i>charset</i> parameter is omitted,
* <i>string</i> are assumed to be encoded in
* iconv.internal_encoding.
@ -147,7 +147,7 @@ function iconv_strlen(string $string, ?string $encoding = 'ini_get("iconv.intern
* </p>
*/
#[Pure]
function iconv_substr(string $string, int $offset, ?int $length, ?string $encoding = 'ini_get("iconv.internal_encoding")'): string|false {}
function iconv_substr(string $string, int $offset, ?int $length, ?string $encoding = null): string|false {}
/**
* Finds position of first occurrence of a needle within a haystack
@ -162,7 +162,7 @@ function iconv_substr(string $string, int $offset, ?int $length, ?string $encodi
* The optional <i>offset</i> parameter specifies
* the position from which the search should be performed.
* </p>
* @param string|null $encoding [optional] <p>
* @param string|null $encoding <p>
* If <i>charset</i> parameter is omitted,
* <i>string</i> are assumed to be encoded in
* iconv.internal_encoding.
@ -175,7 +175,7 @@ function iconv_substr(string $string, int $offset, ?int $length, ?string $encodi
* </p>
*/
#[Pure]
function iconv_strpos(string $haystack, string $needle, int $offset = 0, ?string $encoding = 'ini_get("iconv.internal_encoding")'): int|false {}
function iconv_strpos(string $haystack, string $needle, int $offset = 0, ?string $encoding = null): int|false {}
/**
* Finds the last occurrence of a needle within a haystack
@ -186,7 +186,7 @@ function iconv_strpos(string $haystack, string $needle, int $offset = 0, ?string
* @param string $needle <p>
* The searched substring.
* </p>
* @param string|null $encoding [optional] <p>
* @param string|null $encoding <p>
* If <i>charset</i> parameter is omitted,
* <i>string</i> are assumed to be encoded in
* iconv.internal_encoding.
@ -199,7 +199,7 @@ function iconv_strpos(string $haystack, string $needle, int $offset = 0, ?string
* </p>
*/
#[Pure]
function iconv_strrpos(string $haystack, string $needle, ?string $encoding = 'ini_get("iconv.internal_encoding")'): int|false {}
function iconv_strrpos(string $haystack, string $needle, ?string $encoding = null): int|false {}
/**
* Composes a MIME header field
@ -210,7 +210,7 @@ function iconv_strrpos(string $haystack, string $needle, ?string $encoding = 'in
* @param string $field_value <p>
* The field value.
* </p>
* @param array $options [optional] <p>
* @param array $options <p>
* You can control the behaviour of <b>iconv_mime_encode</b>
* by specifying an associative array that contains configuration items
* to the optional third parameter <i>preferences</i>.
@ -300,7 +300,7 @@ function iconv_strrpos(string $haystack, string $needle, ?string $encoding = 'in
* or <b>FALSE</b> if an error occurs during the encoding.
*/
#[Pure]
function iconv_mime_encode(string $field_name, string $field_value, array $options): string|false {}
function iconv_mime_encode(string $field_name, string $field_value, array $options = []): string|false {}
/**
* Decodes a MIME header field
@ -342,7 +342,7 @@ function iconv_mime_encode(string $field_name, string $field_value, array $optio
* </tr>
* </table>
* </p>
* @param string|null $encoding [optional] <p>
* @param string|null $encoding <p>
* The optional <i>charset</i> parameter specifies the
* character set to represent the result by. If omitted,
* iconv.internal_encoding
@ -352,7 +352,7 @@ function iconv_mime_encode(string $field_name, string $field_value, array $optio
* or <b>FALSE</b> if an error occurs during the decoding.
*/
#[Pure]
function iconv_mime_decode(string $string, int $mode = 0, ?string $encoding = 'ini_get("iconv.internal_encoding")'): string|false {}
function iconv_mime_decode(string $string, int $mode = 0, ?string $encoding = null): string|false {}
/**
* Decodes multiple MIME header fields at once
@ -394,7 +394,7 @@ function iconv_mime_decode(string $string, int $mode = 0, ?string $encoding = 'i
* </td>
* </tr>
* </table>
* @param string|null $encoding [optional] <p>
* @param string|null $encoding <p>
* The optional <i>charset</i> parameter specifies the
* character set to represent the result by. If omitted,
* iconv.internal_encoding
@ -413,7 +413,7 @@ function iconv_mime_decode(string $string, int $mode = 0, ?string $encoding = 'i
* </p>
*/
#[Pure]
function iconv_mime_decode_headers(string $headers, int $mode = 0, ?string $encoding = 'ini_get("iconv.internal_encoding")'): array|false {}
function iconv_mime_decode_headers(string $headers, int $mode = 0, ?string $encoding = null): array|false {}
/**
* string

View File

@ -42,14 +42,14 @@ use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable;
* @param int $retries [optional] <p>
* Number of maximum connect attempts
* </p>
* @param null|array $options [optional] <p>
* @param null|array $options <p>
* Connection parameters, the following (string) keys maybe used
* to set one or more connection parameters:
* DISABLE_AUTHENTICATOR - Disable authentication properties</p>
* @return resource|false an IMAP stream on success or <b>FALSE</b> on error.
*/
#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection|false'], default: 'resource|false')]
function imap_open(string $mailbox, string $user, string $password, int $flags = 0, int $retries = 0, array $options = null) {}
function imap_open(string $mailbox, string $user, string $password, int $flags = 0, int $retries = 0, array $options = []) {}
/**
* Reopen IMAP stream to new mailbox
@ -926,11 +926,18 @@ function imap_clearflag_full(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection
* following:
* <b>SE_UID</b> - Return UIDs instead of sequence numbers</p>
* @param string $search_criteria [optional]
* @param string $charset [optional]
* @param string $charset
* @return array|false an array of message numbers sorted by the given
* parameters.
*/
function imap_sort(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, int $criteria, bool $reverse, int $flags = 0, ?string $search_criteria = null, ?string $charset = 'NIL'): array|false {}
function imap_sort(
#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap,
int $criteria,
bool $reverse,
int $flags = 0,
?string $search_criteria = null,
?string $charset = null
): array|false {}
/**
* This function returns the UID for the given message sequence number
@ -1080,14 +1087,19 @@ function imap_last_error(): string|false {}
* <b>SE_UID</b>, which causes the returned array to
* contain UIDs instead of messages sequence numbers.
* </p>
* @param string $charset [optional]
* @param string $charset
* @return array|false an array of message numbers or UIDs.
* <p>
* Return <b>FALSE</b> if it does not understand the search
* <i>criteria</i> or no messages have been found.
* </p>
*/
function imap_search(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, string $criteria, int $flags = SE_FREE, string $charset = ''): array|false {}
function imap_search(
#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap,
string $criteria,
int $flags = SE_FREE,
string $charset = ""
): array|false {}
/**
* Decodes a modified UTF-7 encoded string

View File

@ -3838,7 +3838,7 @@ function collator_set_strength(Collator $object, int $strength): bool {}
* @param string[] &$array <p>
* Array of strings to sort.
* </p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* Optional sorting type, one of the following:
* </p>
* <p>
@ -3847,7 +3847,7 @@ function collator_set_strength(Collator $object, int $strength): bool {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function collator_sort(Collator $object, array &$array, int $flags = null): bool {}
function collator_sort(Collator $object, array &$array, int $flags = 0): bool {}
/**
* (PHP 5 &gt;= 5.3.0, PECL intl &gt;= 1.0.0)<br/>
@ -3865,14 +3865,14 @@ function collator_sort_with_sort_keys(Collator $object, array &$array): bool {}
* @link https://php.net/manual/en/collator.asort.php
* @param Collator $object
* @param string[] &$array <p>Array of strings to sort.</p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* Optional sorting type, one of the following:
* <b>Collator::SORT_REGULAR</b>
* - compare items normally (don't change types)
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function collator_asort(Collator $object, array &$array, int $flags = null): bool {}
function collator_asort(Collator $object, array &$array, int $flags = 0): bool {}
/**
* (PHP 5 &gt;= 5.3.0, PECL intl &gt;= 1.0.0)<br/>
@ -3961,14 +3961,14 @@ function numfmt_create(string $locale, int $style, #[TypeAware(['8.0' => 'string
* The value to format. Can be integer or float,
* other values will be converted to a numeric value.
* </p>
* @param int $type [optional] <p>
* @param int $type <p>
* The
* formatting type to use.
* </p>
* @return string|false the string containing formatted value, or <b>FALSE</b> on error.
*/
#[Pure]
function numfmt_format(NumberFormatter $formatter, int|float $num, int $type = null): string|false {}
function numfmt_format(NumberFormatter $formatter, int|float $num, int $type = 0): string|false {}
/**
* (PHP 5 &gt;= 5.3.0, PECL intl &gt;= 1.0.0)<br/>
@ -4144,7 +4144,7 @@ function numfmt_get_pattern(NumberFormatter $formatter): string|false {}
* Get formatter locale
* @link https://php.net/manual/en/numberformatter.getlocale.php
* @param NumberFormatter $formatter
* @param int $type [optional] <p>
* @param int $type <p>
* You can choose between valid and actual locale (
* <b>Locale::VALID_LOCALE</b>,
* <b>Locale::ACTUAL_LOCALE</b>,
@ -4153,7 +4153,7 @@ function numfmt_get_pattern(NumberFormatter $formatter): string|false {}
* @return string|false The locale name used to create the formatter.
*/
#[Pure]
function numfmt_get_locale(NumberFormatter $formatter, int $type = null): string|false {}
function numfmt_get_locale(NumberFormatter $formatter, int $type = 0): string|false {}
/**
* (PHP 5 &gt;= 5.3.0, PECL intl &gt;= 1.0.0)<br/>
@ -5115,7 +5115,7 @@ function grapheme_stristr(string $haystack, string $needle, bool $beforeNeedle =
* @param int $size <p>
* Maximum number items - based on the $extract_type - to return.
* </p>
* @param int $type [optional] <p>
* @param int $type <p>
* Defines the type of units referred to by the $size parameter:
* </p>
* <p>
@ -5139,7 +5139,7 @@ function grapheme_stristr(string $haystack, string $needle, bool $beforeNeedle =
* @return string|false A string starting at offset $start and ending on a default grapheme cluster
* boundary that conforms to the $size and $extract_type specified.
*/
function grapheme_extract(string $haystack, int $size, int $type = null, int $offset = 0, &$next = null): string|false {}
function grapheme_extract(string $haystack, int $size, int $type = 0, int $offset = 0, &$next = null): string|false {}
/**
* (PHP 5 &gt;= 5.3.0, PHP 7, PECL intl &gt;= 1.0.2, PHP 7, PECL idn &gt;= 0.1)<br/>
@ -6469,7 +6469,7 @@ function resourcebundle_get_error_message(ResourceBundle $bundle): string {}
* @param string $id <p>
* The id.
* </p>
* @param int $direction [optional] <p>
* @param int $direction <p>
* The direction, defaults to
* Transliterator::FORWARD.
* May also be set to
@ -6480,7 +6480,7 @@ function resourcebundle_get_error_message(ResourceBundle $bundle): string {}
* @since 5.4
*/
#[Pure]
function transliterator_create(string $id, int $direction = null): ?Transliterator {}
function transliterator_create(string $id, int $direction = 0): ?Transliterator {}
/**
* (PHP &gt;= 5.4.0, PECL intl &gt;= 2.0.0)<br/>
@ -6489,7 +6489,7 @@ function transliterator_create(string $id, int $direction = null): ?Transliterat
* @param string $rules <p>
* The rules.
* </p>
* @param int $direction [optional] <p>
* @param int $direction <p>
* The direction, defaults to
* Transliterator::FORWARD.
* May also be set to
@ -6500,7 +6500,7 @@ function transliterator_create(string $id, int $direction = null): ?Transliterat
* @since 5.4
*/
#[Pure]
function transliterator_create_from_rules(string $rules, int $direction = null): ?Transliterator {}
function transliterator_create_from_rules(string $rules, int $direction = 0): ?Transliterator {}
/**
* (PHP &gt;= 5.4.0, PECL intl &gt;= 2.0.0)<br/>
@ -6533,12 +6533,12 @@ function transliterator_create_inverse(Transliterator $transliterator): ?Transli
* @param string $string <p>
* The string to be transformed.
* </p>
* @param int $start [optional] <p>
* @param int $start <p>
* The start index (in UTF-16 code units) from which the string will start
* to be transformed, inclusive. Indexing starts at 0. The text before will
* be left as is.
* </p>
* @param int $end [optional] <p>
* @param int $end <p>
* The end index (in UTF-16 code units) until which the string will be
* transformed, exclusive. Indexing starts at 0. The text after will be
* left as is.
@ -6547,7 +6547,7 @@ function transliterator_create_inverse(Transliterator $transliterator): ?Transli
* @since 5.4
*/
#[Pure]
function transliterator_transliterate(Transliterator|string $transliterator, string $string, int $start = null, int $end = -1): string|false {}
function transliterator_transliterate(Transliterator|string $transliterator, string $string, int $start = 0, int $end = -1): string|false {}
/**
* (PHP &gt;= 5.4.0, PECL intl &gt;= 2.0.0)<br/>

View File

@ -108,7 +108,7 @@ function json_encode(mixed $value, int $flags = 0, int $depth = 512): string|fal
* JSON - it will also encode and decode scalar types and <b>NULL</b>. The JSON standard
* only supports these values when they are nested inside an array or an object.
* </p>
* @param bool|null $associative [optional] <p>
* @param bool|null $associative <p>
* When <b>TRUE</b>, returned objects will be converted into
* associative arrays.
* </p>
@ -130,7 +130,7 @@ function json_encode(mixed $value, int $flags = 0, int $depth = 512): string|fal
* <i>json</i> cannot be decoded or if the encoded
* data is deeper than the recursion limit.
*/
function json_decode(string $json, ?bool $associative = false, int $depth = 512, int $flags = 0): mixed {}
function json_decode(string $json, ?bool $associative = null, int $depth = 512, int $flags = 0): mixed {}
/**
* Returns the last error occurred

View File

@ -28,7 +28,7 @@ function ldap_exop_passwd(
#[Available(from: '7.1', to: '7.1')] string $new_password = "",
#[Available(from: '7.2', to: '7.2')] string $new_password,
#[Available(from: '7.3')] string $new_password = "",
#[Available(from: '7.3')] &$controls = []
#[Available(from: '7.3')] &$controls = null
): string|bool {}
/**
@ -57,14 +57,14 @@ function ldap_exop_whoami(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], defaul
* @param resource $ldap An LDAP link identifier, returned by ldap_connect().
* @param string $request_oid The extended operation request OID. You may use one of LDAP_EXOP_START_TLS, LDAP_EXOP_MODIFY_PASSWD, LDAP_EXOP_REFRESH, LDAP_EXOP_WHO_AM_I, LDAP_EXOP_TURN, or a string with the OID of the operation you want to send.
* @param string|null $request_data [optional] The extended operation request data. May be NULL for some operations like LDAP_EXOP_WHO_AM_I, may also need to be BER encoded.
* @param array|null $controls [optional] If provided, a password policy request control is send with the request and this is filled with an array of LDAP Controls returned with the request.
* @param array|null $controls If provided, a password policy request control is send with the request and this is filled with an array of LDAP Controls returned with the request.
* @param string &$response_data [optional] Will be filled with the extended operation response data if provided. If not provided you may use ldap_parse_exop on the result object later to get this data.
* @param string &$response_oid [optional] Will be filled with the response OID if provided, usually equal to the request OID.
* @return resource|bool When used with retdata, returns TRUE on success or FALSE on error. When used without retdata, returns a result identifier or FALSE on error.
* @since 7.2
*/
#[PhpVersionAware(['8.1' => 'LDAP\Result|bool'], default: 'resource|bool')]
function ldap_exop(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap, string $request_oid, ?string $request_data, #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = [], &$response_data, &$response_oid) {}
function ldap_exop(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap, string $request_oid, ?string $request_data, #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null, &$response_data, &$response_oid) {}
/**
* Parse LDAP extended operation data from result object result
@ -80,9 +80,9 @@ function ldap_parse_exop(
#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap,
#[PhpVersionAware(['8.1' => 'LDAP\Result'], default: 'resource')] $result,
#[Available(from: '7.2', to: '7.4')] &$response_data,
#[Available(from: '8.0')] &$response_data = '',
#[Available(from: '8.0')] &$response_data = null,
#[Available(from: '7.2', to: '7.4')] &$response_oid,
#[Available(from: '8.0')] &$response_oid = ''
#[Available(from: '8.0')] &$response_oid = null
): bool {}
/**
@ -156,12 +156,17 @@ function ldap_bind(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'res
* </p>
* @param string|null $dn [optional]
* @param string|null $password [optional]
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return resource|false
* @since 7.3
*/
#[PhpVersionAware(['8.1' => 'LDAP\Result|false'], default: 'resource|false')]
function ldap_bind_ext(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap, ?string $dn, ?string $password, #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []) {}
function ldap_bind_ext(
#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap,
?string $dn,
?string $password,
#[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null
) {}
/**
* Bind to LDAP directory using SASL
@ -204,7 +209,7 @@ function ldap_unbind(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'r
* used on the directory server, you might use an appropriate filter such
* as objectClass=inetOrgPerson.
* </p>
* @param array $attributes [optional] <p>
* @param array $attributes <p>
* An array of the required attributes, e.g. array("mail", "sn", "cn").
* Note that the "dn" is always returned irrespective of which attributes
* types are requested.
@ -215,7 +220,7 @@ function ldap_unbind(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'r
* The use of this parameter should therefore be considered good
* practice.
* </p>
* @param int $attributes_only [optional] <p>
* @param int $attributes_only <p>
* Should be set to 1 if only attribute types are wanted. If set to 0
* both attributes types and attribute values are fetched which is the
* default behaviour.
@ -242,12 +247,12 @@ function ldap_unbind(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'r
* This parameter can NOT override server-side preset timelimit. You can
* set it lower though.
* </p>
* @param int $deref [optional] <p>
* @param int $deref <p>
* Specifies how aliases should be handled during the search. It can be
* one of the following:
* <b>LDAP_DEREF_NEVER</b> - (default) aliases are never
* dereferenced.</p>
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return resource|false a search result identifier or <b>FALSE</b> on error.
*/
#[PhpVersionAware(['8.1' => 'LDAP\Result|array|false'], default: 'resource|false')]
@ -255,12 +260,12 @@ function ldap_read(
#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap,
array|string $base,
array|string $filter,
array $attributes,
int $attributes_only,
array $attributes = [],
int $attributes_only = 0,
int $sizelimit = -1,
int $timelimit = -1,
int $deref,
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []
int $deref = 0,
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null
) {}
/**
@ -273,7 +278,7 @@ function ldap_read(
* The base DN for the directory.
* </p>
* @param array|string $filter
* @param array $attributes [optional] <p>
* @param array $attributes <p>
* An array of the required attributes, e.g. array("mail", "sn", "cn").
* Note that the "dn" is always returned irrespective of which attributes
* types are requested.
@ -284,7 +289,7 @@ function ldap_read(
* The use of this parameter should therefore be considered good
* practice.
* </p>
* @param int $attributes_only [optional] <p>
* @param int $attributes_only <p>
* Should be set to 1 if only attribute types are wanted. If set to 0
* both attributes types and attribute values are fetched which is the
* default behaviour.
@ -311,12 +316,12 @@ function ldap_read(
* This parameter can NOT override server-side preset timelimit. You can
* set it lower though.
* </p>
* @param int $deref [optional] <p>
* @param int $deref <p>
* Specifies how aliases should be handled during the search. It can be
* one of the following:
* <b>LDAP_DEREF_NEVER</b> - (default) aliases are never
* dereferenced.</p>
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return resource|false a search result identifier or <b>FALSE</b> on error.
*/
#[PhpVersionAware(['8.1' => 'LDAP\Result|array|false'], default: 'resource|false')]
@ -324,12 +329,12 @@ function ldap_list(
#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap,
array|string $base,
array|string $filter,
array $attributes,
int $attributes_only,
array $attributes = [],
int $attributes_only = 0,
int $sizelimit = -1,
int $timelimit = -1,
int $deref,
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []
int $deref = 0,
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null
) {}
/**
@ -346,7 +351,7 @@ function ldap_list(
* the format described in the LDAP documentation (see the Netscape Directory SDK for full
* information on filters).
* </p>
* @param array $attributes [optional] <p>
* @param array $attributes <p>
* An array of the required attributes, e.g. array("mail", "sn", "cn").
* Note that the "dn" is always returned irrespective of which attributes
* types are requested.
@ -357,7 +362,7 @@ function ldap_list(
* The use of this parameter should therefore be considered good
* practice.
* </p>
* @param int $attributes_only [optional] <p>
* @param int $attributes_only <p>
* Should be set to 1 if only attribute types are wanted. If set to 0
* both attributes types and attribute values are fetched which is the
* default behaviour.
@ -384,12 +389,12 @@ function ldap_list(
* This parameter can NOT override server-side preset timelimit. You can
* set it lower though.
* </p>
* @param int $deref [optional] <p>
* @param int $deref <p>
* Specifies how aliases should be handled during the search. It can be
* one of the following:
* <b>LDAP_DEREF_NEVER</b> - (default) aliases are never
* dereferenced.</p>
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return resource|false a search result identifier or <b>FALSE</b> on error.
*/
#[PhpVersionAware(['8.1' => 'LDAP\Result|array|false'], default: 'resource|false')]
@ -397,12 +402,12 @@ function ldap_search(
#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap,
array|string $base,
array|string $filter,
array $attributes,
int $attributes_only,
array $attributes = [],
int $attributes_only = 0,
int $sizelimit = -1,
int $timelimit = -1,
int $deref,
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []
int $deref = 0,
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null
) {}
/**
@ -651,14 +656,14 @@ function ldap_dn2ufn(string $dn): string|false {}
* $entree["attribut2"][1] = "value2";
* </code>
* </p>
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_add(
#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap,
string $dn,
array $entry,
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null
): bool {}
/**
@ -682,12 +687,17 @@ function ldap_add(
* $entree["attribut2"][1] = "value2";
* </code>
* </p>
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return resource|false
* @since 7.3
*/
#[PhpVersionAware(['8.1' => 'LDAP\Result|false'], default: 'resource|false')]
function ldap_add_ext(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap, string $dn, array $entry, #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []) {}
function ldap_add_ext(
#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap,
string $dn,
array $entry,
#[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null
) {}
/**
* Delete an entry from a directory
@ -698,13 +708,13 @@ function ldap_add_ext(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: '
* @param string $dn <p>
* The distinguished name of an LDAP entity.
* </p>
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_delete(
#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap,
string $dn,
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null
): bool {}
/**
@ -717,12 +727,16 @@ function ldap_delete(
* @param string $dn <p>
* The distinguished name of an LDAP entity.
* </p>
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return resource|false
* @since 7.3
*/
#[PhpVersionAware(['8.1' => 'LDAP\Result|false'], default: 'resource|false')]
function ldap_delete_ext(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap, string $dn, #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []) {}
function ldap_delete_ext(
#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap,
string $dn,
#[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null
) {}
/**
* This function is an alias of: ldap_mod_replace().
@ -735,7 +749,7 @@ function ldap_delete_ext(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
* @since 7.0
*/
@ -743,7 +757,7 @@ function ldap_modify(
#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap,
string $dn,
array $entry,
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null
): bool {}
/**
@ -756,14 +770,14 @@ function ldap_modify(
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_mod_add(
#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap,
string $dn,
array $entry,
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null
): bool {}
/**
@ -777,12 +791,17 @@ function ldap_mod_add(
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return resource|false
* @since 7.3
*/
#[PhpVersionAware(['8.1' => 'LDAP\Result|false'], default: 'resource|false')]
function ldap_mod_add_ext(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap, string $dn, array $entry, #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []) {}
function ldap_mod_add_ext(
#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap,
string $dn,
array $entry,
#[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null
) {}
/**
* Replace attribute values with new ones
@ -794,14 +813,14 @@ function ldap_mod_add_ext(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], defaul
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_mod_replace(
#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap,
string $dn,
array $entry,
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null
): bool {}
/**
@ -815,12 +834,12 @@ function ldap_mod_replace(
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return resource|false
* @since 7.3
*/
#[PhpVersionAware(['8.1' => 'LDAP\Result|false'], default: 'resource|false')]
function ldap_mod_replace_ext(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap, string $dn, array $entry, #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []) {}
function ldap_mod_replace_ext(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap, string $dn, array $entry, #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null) {}
/**
* Delete attribute values from current attributes
@ -832,14 +851,14 @@ function ldap_mod_replace_ext(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], de
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_mod_del(
#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap,
string $dn,
array $entry,
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null
): bool {}
/**
@ -853,12 +872,12 @@ function ldap_mod_del(
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return resource|false
* @since 7.3
*/
#[PhpVersionAware(['8.1' => 'LDAP\Result|false'], default: 'resource|false')]
function ldap_mod_del_ext(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap, string $dn, array $entry, #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []) {}
function ldap_mod_del_ext(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap, string $dn, array $entry, #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null) {}
/**
* Return the LDAP error number of the last LDAP command
@ -906,7 +925,7 @@ function ldap_error(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 're
* @param string $value <p>
* The compared value.
* </p>
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return int|bool <b>TRUE</b> if <i>value</i> matches otherwise returns
* <b>FALSE</b>. Returns -1 on error.
*/
@ -915,7 +934,7 @@ function ldap_compare(
string $dn,
string $attribute,
string $value,
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null
): int|bool {}
/**
@ -956,7 +975,7 @@ function ldap_sort(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'res
* If <b>TRUE</b> the old RDN value(s) is removed, else the old RDN value(s)
* is retained as non-distinguished values of the entry.
* </p>
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_rename(
@ -965,7 +984,7 @@ function ldap_rename(
string $new_rdn,
string $new_parent,
bool $delete_old_rdn,
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null
): bool {}
/**
@ -988,12 +1007,12 @@ function ldap_rename(
* If <b>TRUE</b> the old RDN value(s) is removed, else the old RDN value(s)
* is retained as non-distinguished values of the entry.
* </p>
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return resource|false
* @since 7.3
*/
#[PhpVersionAware(['8.1' => 'LDAP\Result|false'], default: 'resource|false')]
function ldap_rename_ext(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []) {}
function ldap_rename_ext(#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null) {}
/**
* Get the current value for given option
@ -1226,7 +1245,7 @@ function ldap_parse_reference(
* @param string &$matched_dn [optional]
* @param string &$error_message [optional]
* @param array &$referrals [optional]
* @param array &$controls [optional] An array of LDAP Controls which have been sent with the response.
* @param array &$controls An array of LDAP Controls which have been sent with the response.
* @return bool
*/
function ldap_parse_result(
@ -1236,7 +1255,7 @@ function ldap_parse_result(
&$matched_dn,
&$error_message,
&$referrals,
#[Available(from: '7.3')] &$controls = []
#[Available(from: '7.3')] &$controls = null
): bool {}
/**
@ -1380,7 +1399,7 @@ function ldap_escape(string $value, string $ignore = "", int $flags = 0): string
* any value for <em>modtype</em> must be one of the
* <b>LDAP_MODIFY_BATCH_*</b> constants listed above.
* </p>
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls Array of LDAP Controls to send with the request.
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
* @since 5.4
*/
@ -1388,7 +1407,7 @@ function ldap_modify_batch(
#[PhpVersionAware(['8.1' => 'LDAP\Connection'], default: 'resource')] $ldap,
string $dn,
array $modifications_info,
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = []
#[Available(from: '7.3')] #[PhpVersionAware(["8.0" => "null|array"], default: "array")] $controls = null
): bool {}
/**

View File

@ -77,7 +77,7 @@ function libxml_set_streams_context($context): void {}
/**
* Disable libxml errors and allow user to fetch error information as needed
* @link https://php.net/manual/en/function.libxml-use-internal-errors.php
* @param bool|null $use_errors [optional] <p>
* @param bool|null $use_errors <p>
* Enable (<b>TRUE</b>) user error handling or disable (<b>FALSE</b>) user error handling. Disabling will also clear any existing libxml errors.
* </p>
* @return bool This function returns the previous value of

View File

@ -548,7 +548,7 @@ function mb_strwidth(string $string, ?string $encoding): int {}
* @param int $width <p>
* The width of the desired trim.
* </p>
* @param string $trim_marker [optional] <p>
* @param string $trim_marker <p>
* A string that is added to the end of string
* when string is truncated.
* </p>
@ -557,7 +557,7 @@ function mb_strwidth(string $string, ?string $encoding): int {}
* trimmarker is appended to the return value.
*/
#[Pure]
function mb_strimwidth(string $string, int $start, int $width, string $trim_marker, ?string $encoding): string {}
function mb_strimwidth(string $string, int $start, int $width, string $trim_marker = '', ?string $encoding): string {}
/**
* Convert character encoding
@ -770,14 +770,14 @@ function mb_convert_kana(string $string, string $mode = 'KV', ?string $encoding)
* lines. The length is currently hard-coded to 74 characters).
* Falls back to "\r\n" (CRLF) if not given.
* </p>
* @param int $indent [optional] <p>
* @param int $indent <p>
* Indentation of the first line (number of characters in the header
* before str).
* </p>
* @return string A converted version of the string represented in ASCII.
*/
#[Pure]
function mb_encode_mimeheader(string $string, ?string $charset, ?string $transfer_encoding, string $newline = "\n", int $indent): string {}
function mb_encode_mimeheader(string $string, ?string $charset, ?string $transfer_encoding, string $newline = "\n", int $indent = 0): string {}
/**
* Decode string in MIME header field
@ -872,7 +872,7 @@ function mb_decode_numericentity(string $string, array $map, ?string $encoding =
* @param string $message <p>
* The message of the mail.
* </p>
* @param string|array $additional_headers [optional] <p>
* @param string|array $additional_headers <p>
* String or array to be inserted at the end of the email header. <br/>
* Since 7.2.0 accepts an array. Its keys are the header names and its values are the respective header values.<br/>
* This is typically used to add extra
@ -886,7 +886,7 @@ function mb_decode_numericentity(string $string, array $map, ?string $encoding =
* </p>
* @return bool true on success or false on failure.
*/
function mb_send_mail(string $to, string $subject, string $message, array|string $additional_headers, ?string $additional_params): bool {}
function mb_send_mail(string $to, string $subject, string $message, array|string $additional_headers = [], ?string $additional_params): bool {}
/**
* Get internal settings of mbstring
@ -994,7 +994,7 @@ function mb_eregi(string $pattern, string $string, &$matches): bool {}
* @param string $string <p>
* The string being checked.
* </p>
* @param string|null $options [optional] Matching condition can be set by option
* @param string|null $options Matching condition can be set by option
* parameter. If i is specified for this
* parameter, the case will be ignored. If x is
* specified, white space will be ignored. If m
@ -1008,7 +1008,7 @@ function mb_eregi(string $pattern, string $string, &$matches): bool {}
* @return string|false|null The resultant string on success, or false on error.
*/
#[Pure]
function mb_ereg_replace(string $pattern, string $replacement, string $string, ?string $options = "msr"): string|false|null {}
function mb_ereg_replace(string $pattern, string $replacement, string $string, ?string $options = null): string|false|null {}
/**
* Perform a regular expresssion seach and replace with multibyte support using a callback
@ -1037,7 +1037,7 @@ function mb_ereg_replace(string $pattern, string $replacement, string $string, ?
* @param string $string <p>
* The string being checked.
* </p>
* @param string $options [optional <p>
* @param string $options <p>
* Matching condition can be set by <em><b>option</b></em>
* parameter. If <em>i</em> is specified for this
* parameter, the case will be ignored. If <em>x</em> is
@ -1053,7 +1053,7 @@ function mb_ereg_replace(string $pattern, string $replacement, string $string, ?
* </p>
* @since 5.4.1
*/
function mb_ereg_replace_callback(string $pattern, callable $callback, string $string, ?string $options = "msr"): string|false|null {}
function mb_ereg_replace_callback(string $pattern, callable $callback, string $string, ?string $options = null): string|false|null {}
/**
* Replace regular expression with multibyte support ignoring case
@ -1067,13 +1067,13 @@ function mb_ereg_replace_callback(string $pattern, callable $callback, string $s
* @param string $string <p>
* The searched string.
* </p>
* @param string|null $options [optional] option has the same meaning as in
* @param string|null $options option has the same meaning as in
* mb_ereg_replace.
* <p>PHP 7.1: The <i>e</i> modifier has been deprecated.</p>
* @return string|false|null The resultant string or false on error.
*/
#[Pure]
function mb_eregi_replace(string $pattern, string $replacement, string $string, ?string $options = "msr"): string|false|null {}
function mb_eregi_replace(string $pattern, string $replacement, string $string, ?string $options = null): string|false|null {}
/**
* Split multibyte string using regular expression

View File

@ -2302,10 +2302,10 @@ function mysqli_query(
* @param string|null $database [optional]
* @param int|null $port [optional]
* @param string|null $socket [optional]
* @param int $flags [optional]
* @param int $flags
* @return bool
*/
function mysqli_real_connect(mysqli $mysql, ?string $hostname, ?string $username, ?string $password, ?string $database, ?int $port, ?string $socket, int $flags): bool {}
function mysqli_real_connect(mysqli $mysql, ?string $hostname, ?string $username, ?string $password, ?string $database, ?int $port, ?string $socket, int $flags = 0): bool {}
/**
* Escapes special characters in a string for use in an SQL statement, taking into account the current charset of the connection

View File

@ -93,7 +93,7 @@ function openssl_pkey_export_to_file(
* </li>
* <li>A PEM formatted private key.</li>
* </ol></p>
* @param string|null $passphrase [optional] <p>
* @param string|null $passphrase <p>
* The optional parameter <b><em>passphrase</em></b> must be used
* if the specified key is encrypted (protected by a passphrase).
* </p>
@ -102,7 +102,7 @@ function openssl_pkey_export_to_file(
#[LanguageLevelTypeAware(["8.0" => "OpenSSLAsymmetricKey|false"], default: "resource|false")]
function openssl_pkey_get_private(
#[LanguageLevelTypeAware(['8.0' => 'OpenSSLAsymmetricKey|OpenSSLCertificate|array|string'], default: 'resource|array|string')] $private_key,
?string $passphrase = ""
?string $passphrase = null
) {}
/**
@ -445,11 +445,11 @@ function openssl_pkcs12_export(
* @param string $passphrase <p>
* Encryption password for unlocking the PKCS#12 file.
* </p>
* @param array $options [optional]
* @param array $options
* @return bool true on success or false on failure.
* @since 5.2.2
*/
function openssl_pkcs12_export_to_file(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, string $output_filename, $private_key, string $passphrase, array $options): bool {}
function openssl_pkcs12_export_to_file(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, string $output_filename, $private_key, string $passphrase, array $options = []): bool {}
/**
* Parse a PKCS#12 Certificate Store into an array
@ -730,7 +730,7 @@ function openssl_encrypt(
* @param string $iv [optional] <p>
* A non-NULL Initialization Vector.
* </p>
* @param string|null $tag [optional] <p>
* @param string|null $tag <p>
* The authentication tag in AEAD cipher mode. If it is incorrect, the authentication fails and the function returns <b>FALSE</b>.
* </p>
* @param string $aad [optional] <p>Additional authentication data.</p>
@ -742,7 +742,7 @@ function openssl_decrypt(
string $passphrase,
int $options = 0,
string $iv = "",
#[PhpStormStubsElementAvailable(from: '7.1')] #[LanguageLevelTypeAware(['8.1' => 'string|null'], default: 'string')] $tag = "",
#[PhpStormStubsElementAvailable(from: '7.1')] #[LanguageLevelTypeAware(['8.1' => 'string|null'], default: 'string')] $tag = null,
#[PhpStormStubsElementAvailable(from: '7.1')] string $aad = ""
): string|false {}
@ -818,7 +818,7 @@ function openssl_seal(
array $public_key,
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $cipher_algo = '',
#[PhpStormStubsElementAvailable(from: '8.0')] string $cipher_algo,
&$iv = ''
&$iv = null
): int|false {}
/**
@ -874,7 +874,7 @@ function openssl_pbkdf2(string $password, string $salt, int $key_length, int $it
* string holding the name of a file into which the certificates of the
* persons that signed the messages will be stored in PEM format.
* </p>
* @param array $ca_info [optional] <p>
* @param array $ca_info <p>
* If the <i>cainfo</i> is specified, it should hold
* information about the trusted CA certificates to use in the verification
* process - see certificate
@ -898,7 +898,7 @@ function openssl_pkcs7_verify(
string $input_filename,
int $flags,
?string $signers_certificates_filename,
array $ca_info,
array $ca_info = [],
?string $untrusted_certificates_filename,
?string $content,
#[PhpStormStubsElementAvailable("7.2")] ?string $output_filename
@ -1178,7 +1178,7 @@ function openssl_pkcs7_read(string $data, &$certificates): bool {}
* @param string $input_filename
* @param int $flags [optional]
* @param string|null $certificates [optional]
* @param array $ca_info [optional]
* @param array $ca_info
* @param string|null $untrusted_certificates_filename [optional]
* @param string|null $content [optional]
* @param string|null $pk7 [optional]
@ -1187,7 +1187,7 @@ function openssl_pkcs7_read(string $data, &$certificates): bool {}
* @return bool
* @since 8.0
*/
function openssl_cms_verify(string $input_filename, int $flags = 0, ?string $certificates, array $ca_info, ?string $untrusted_certificates_filename, ?string $content, ?string $pk7, ?string $sigfile, int $encoding = OPENSSL_ENCODING_SMIME): bool {}
function openssl_cms_verify(string $input_filename, int $flags = 0, ?string $certificates, array $ca_info = [], ?string $untrusted_certificates_filename, ?string $content, ?string $pk7, ?string $sigfile, int $encoding = OPENSSL_ENCODING_SMIME): bool {}
/**
* Encrypts the message in the file with the certificates and outputs the result to the supplied file.

View File

@ -90,12 +90,12 @@ function pcntl_fork(): int {}
* </tr>
* </table>
* </p>
* @param array &$resource_usage [optional]
* @param array &$resource_usage
* @return int <b>pcntl_waitpid</b> returns the process ID of the
* child which exited, -1 on error or zero if <b>WNOHANG</b> was used and no
* child was available
*/
function pcntl_waitpid(int $process_id, &$status, int $flags = 0, &$resource_usage): int {}
function pcntl_waitpid(int $process_id, &$status, int $flags = 0, &$resource_usage = []): int {}
/**
* Waits on or returns the status of a forked child
@ -136,12 +136,12 @@ function pcntl_waitpid(int $process_id, &$status, int $flags = 0, &$resource_usa
* </tr>
* </table>
* </p>
* @param array &$resource_usage [optional]
* @param array &$resource_usage
* @return int <b>pcntl_wait</b> returns the process ID of the
* child which exited, -1 on error or zero if WNOHANG was provided as an
* option (on wait3-available systems) and no child was available.
*/
function pcntl_wait(&$status, int $flags = 0, &$resource_usage): int {}
function pcntl_wait(&$status, int $flags = 0, &$resource_usage = []): int {}
/**
* Installs a signal handler
@ -265,11 +265,11 @@ function pcntl_wstopsig(int $status): int|false {}
* #!/usr/local/bin/perl for example) as the first line. See your system's
* man execve(2) page for additional information.
* </p>
* @param array $args [optional] <p>
* @param array $args <p>
* <i>args</i> is an array of argument strings passed to the
* program.
* </p>
* @param array $env_vars [optional] <p>
* @param array $env_vars <p>
* <i>envs</i> is an array of strings which are passed as
* environment to the program. The array is in the format of name => value,
* the key being the name of the environmental variable and the value being
@ -277,7 +277,7 @@ function pcntl_wstopsig(int $status): int|false {}
* </p>
* @return bool <b>FALSE</b> on error and does not return on success.
*/
function pcntl_exec(string $path, array $args, array $env_vars): bool {}
function pcntl_exec(string $path, array $args = [], array $env_vars = []): bool {}
/**
* Set an alarm clock for delivery of a signal
@ -391,7 +391,7 @@ function pcntl_sigprocmask(int $mode, array $signals, &$old_signals): bool {}
* @param array $signals <p>
* Array of signals to wait for.
* </p>
* @param array &$info [optional] <p>
* @param array &$info <p>
* The <i>info</i> parameter is set to an array containing
* informations about the signal.
* </p>
@ -423,7 +423,7 @@ function pcntl_sigprocmask(int $mode, array $signals, &$old_signals): bool {}
* </p>
* @return int|false On success, <b>pcntl_sigwaitinfo</b> returns a signal number.
*/
function pcntl_sigwaitinfo(array $signals, &$info): int|false {}
function pcntl_sigwaitinfo(array $signals, &$info = []): int|false {}
/**
* Waits for signals, with a timeout
@ -431,7 +431,7 @@ function pcntl_sigwaitinfo(array $signals, &$info): int|false {}
* @param array $signals <p>
* Array of signals to wait for.
* </p>
* @param array &$info [optional] <p>
* @param array &$info <p>
* The <i>siginfo</i> is set to an array containing
* informations about the signal. See
* <b>pcntl_sigwaitinfo</b>.
@ -444,7 +444,7 @@ function pcntl_sigwaitinfo(array $signals, &$info): int|false {}
* </p>
* @return int|false On success, <b>pcntl_sigtimedwait</b> returns a signal number.
*/
function pcntl_sigtimedwait(array $signals, &$info, int $seconds = 0, int $nanoseconds = 0): int|false {}
function pcntl_sigtimedwait(array $signals, &$info = [], int $seconds = 0, int $nanoseconds = 0): int|false {}
/**
* Enable/disable asynchronous signal handling or return the old setting.<br>

View File

@ -171,7 +171,7 @@ function preg_match(string $pattern, string $subject, &$matches, int $flags = 0,
* @param string[][] &$matches [optional] <p>
* Array of all matches in multi-dimensional array ordered according to flags.
* </p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* Can be a combination of the following flags (note that it doesn't make
* sense to use <b>PREG_PATTERN_ORDER</b> together with
* <b>PREG_SET_ORDER</b>):
@ -216,7 +216,7 @@ function preg_match(string $pattern, string $subject, &$matches, int $flags = 0,
* or <b>FALSE</b> if an error occurred.
*/
#[LanguageLevelTypeAware(['8.0' => 'int|false'], default: 'int|false|null')]
function preg_match_all(string $pattern, string $subject, &$matches, int $flags = PREG_PATTERN_ORDER, int $offset = 0) {}
function preg_match_all(string $pattern, string $subject, &$matches, int $flags = 0, int $offset = 0) {}
/**
* Perform a regular expression search and replace

View File

@ -31,7 +31,7 @@ use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable;
* The <i>options</i> parameter can be used to set command line parameters
* to be invoked by the server.
* </p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* If <b>PGSQL_CONNECT_FORCE_NEW</b> is passed, then a new connection
* is created, even if the <i>connection_string</i> is identical to
* an existing connection.
@ -41,7 +41,7 @@ use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable;
#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection|false'], default: 'resource|false')]
function pg_connect(
string $connection_string,
int $flags = null,
int $flags = 0,
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $host = '',
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $port = '',
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $options = '',
@ -71,7 +71,7 @@ function pg_connect(
* <i>service</i>. Which of these arguments exist depends
* on your PostgreSQL version.
* </p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* If <b>PGSQL_CONNECT_FORCE_NEW</b> is passed, then a new connection
* is created, even if the <i>connection_string</i> is identical to
* an existing connection.
@ -81,7 +81,7 @@ function pg_connect(
#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection|false'], default: 'resource|false')]
function pg_pconnect(
string $connection_string,
#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = null,
#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = 0,
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $host = '',
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $port = '',
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $options = '',
@ -275,7 +275,7 @@ function pg_ping(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection|null'], de
* @return string|false A string containing the value of the parameter, <b>FALSE</b> on failure or invalid
* <i>param_name</i>.
*/
function pg_parameter_status(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, string $name = ''): string|false {}
function pg_parameter_status(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, string $name = null): string|false {}
/**
* Returns the current in-transaction status of the server.
@ -325,7 +325,7 @@ function pg_transaction_status(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connect
function pg_query(
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null,
#[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection,
string $query = ''
string $query = null
) {}
/**
@ -368,7 +368,7 @@ function pg_query_params(
#[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection,
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $query = '',
#[PhpStormStubsElementAvailable(from: '8.0')] $query,
array $params = []
array $params = null
) {}
/**
@ -399,7 +399,7 @@ function pg_prepare(
#[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection,
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $statement_name = '',
#[PhpStormStubsElementAvailable(from: '8.0')] string $statement_name,
string $query = ''
string $query = null
) {}
/**
@ -434,7 +434,7 @@ function pg_execute(
#[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection,
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $statement_name = '',
#[PhpStormStubsElementAvailable(from: '8.0')] $statement_name,
array $params = []
array $params = null
) {}
/**
@ -1134,7 +1134,7 @@ function pg_last_notice(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'],
function pg_put_line(
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null,
#[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection,
string $query = ''
string $query = null
): bool {}
/**
@ -1280,7 +1280,7 @@ function pg_lo_create(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], de
function pg_lo_unlink(
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null,
#[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection,
$oid = 0
$oid = null
): bool {}
/**
@ -1305,8 +1305,8 @@ function pg_lo_unlink(
function pg_lo_open(
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null,
#[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection,
$oid = 0,
string $mode = ''
$oid = null,
string $mode = null
) {}
/**
@ -1477,7 +1477,7 @@ function pg_lo_truncate(
function pg_escape_string(
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null,
#[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection,
string $string = ''
string $string = null
): string {}
/**
@ -1498,7 +1498,7 @@ function pg_escape_string(
function pg_escape_bytea(
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null,
#[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection,
string $string = ''
string $string = null
): string {}
/**
@ -1519,7 +1519,7 @@ function pg_escape_bytea(
function pg_escape_identifier(
#[PhpStormStubsElementAvailable(from: '5.4', to: '7.4')] $connection = null,
#[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection,
string $string = ''
string $string = null
): string|false {}
/**
@ -1540,7 +1540,7 @@ function pg_escape_identifier(
function pg_escape_literal(
#[PhpStormStubsElementAvailable(from: '5.4', to: '7.4')] $connection = null,
#[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection,
string $string = ''
string $string = null
): string|false {}
/**
@ -1576,7 +1576,7 @@ function pg_unescape_bytea(string $string): string {}
function pg_set_error_verbosity(
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null,
#[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection,
int $verbosity = 0
int $verbosity = null
): int|false {}
/**
@ -1617,7 +1617,7 @@ function pg_client_encoding(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection
function pg_set_client_encoding(
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null,
#[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection,
string $encoding = ''
string $encoding = null
): int {}
/**
@ -1814,7 +1814,7 @@ function pg_select(
function pg_exec(
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null,
#[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection,
string $query = ''
string $query = null
) {}
/**

View File

@ -11,24 +11,24 @@ use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware;
* two letter ISO 639 language code and an optional two letter ISO
* 3166 country code after a dash or underscore.
* </p>
* @param string $spelling [optional] <p>
* @param string $spelling <p>
* The spelling parameter is the requested spelling for languages
* with more than one spelling such as English. Known values are
* 'american', 'british', and 'canadian'.
* </p>
* @param string $jargon [optional] <p>
* @param string $jargon <p>
* The jargon parameter contains extra information to distinguish
* two different words lists that have the same language and
* spelling parameters.
* </p>
* @param string $encoding [optional] <p>
* @param string $encoding <p>
* The encoding parameter is the encoding that words are expected to
* be in. Valid values are 'utf-8', 'iso8859-*', 'koi8-r',
* 'viscii', 'cp1252', 'machine unsigned 16', 'machine unsigned
* 32'. This parameter is largely untested, so be careful when
* using.
* </p>
* @param int $mode [optional] <p>
* @param int $mode <p>
* The mode parameter is the mode in which spellchecker will work.
* There are several modes available:
* <b>PSPELL_FAST</b> - Fast mode (least number of
@ -36,7 +36,7 @@ use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware;
* @return int|false the dictionary link identifier on success or <b>FALSE</b> on failure.
*/
#[LanguageLevelTypeAware(['8.1' => 'PSpell\Dictionary|false'], default: 'int|false')]
function pspell_new(string $language, string $spelling = null, string $jargon = null, string $encoding = null, int $mode = 0) {}
function pspell_new(string $language, string $spelling = "", string $jargon = "", string $encoding = "", int $mode = 0) {}
/**
* Load a new dictionary with personal wordlist
@ -52,29 +52,29 @@ function pspell_new(string $language, string $spelling = null, string $jargon =
* code and an optional two letter ISO 3166 country code after a dash
* or underscore.
* </p>
* @param string $spelling [optional] <p>
* @param string $spelling <p>
* The requested spelling for languages with more than one spelling such
* as English. Known values are 'american', 'british', and 'canadian'.
* </p>
* @param string $jargon [optional] <p>
* @param string $jargon <p>
* Extra information to distinguish two different words lists that have
* the same language and spelling parameters.
* </p>
* @param string $encoding [optional] <p>
* @param string $encoding <p>
* The encoding that words are expected to be in. Valid values are
* utf-8, iso8859-*,
* koi8-r, viscii,
* cp1252, machine unsigned 16,
* machine unsigned 32.
* </p>
* @param int $mode [optional] <p>
* @param int $mode <p>
* The mode in which spellchecker will work. There are several modes available:
* <b>PSPELL_FAST</b> - Fast mode (least number of
* suggestions)</p>
* @return int|false the dictionary link identifier for use in other pspell functions.
*/
#[LanguageLevelTypeAware(['8.1' => 'PSpell\Dictionary|false'], default: 'int|false')]
function pspell_new_personal(string $filename, string $language, string $spelling = null, string $jargon = null, string $encoding = null, int $mode = 0) {}
function pspell_new_personal(string $filename, string $language, string $spelling = "", string $jargon = "", string $encoding = "", int $mode = 0) {}
/**
* Load a new dictionary with settings based on a given config
@ -176,17 +176,17 @@ function pspell_save_wordlist(#[LanguageLevelTypeAware(['8.1' => 'PSpell\Diction
* two letter ISO 639 language code and an optional two letter ISO
* 3166 country code after a dash or underscore.
* </p>
* @param string $spelling [optional] <p>
* @param string $spelling <p>
* The spelling parameter is the requested spelling for languages
* with more than one spelling such as English. Known values are
* 'american', 'british', and 'canadian'.
* </p>
* @param string $jargon [optional] <p>
* @param string $jargon <p>
* The jargon parameter contains extra information to distinguish
* two different words lists that have the same language and
* spelling parameters.
* </p>
* @param string $encoding [optional] <p>
* @param string $encoding <p>
* The encoding parameter is the encoding that words are expected to
* be in. Valid values are 'utf-8', 'iso8859-*', 'koi8-r',
* 'viscii', 'cp1252', 'machine unsigned 16', 'machine unsigned
@ -196,7 +196,7 @@ function pspell_save_wordlist(#[LanguageLevelTypeAware(['8.1' => 'PSpell\Diction
* @return int Retuns a pspell config identifier.
*/
#[LanguageLevelTypeAware(['8.1' => 'PSpell\Config'], default: 'int')]
function pspell_config_create(string $language, string $spelling = null, string $jargon = null, string $encoding = null) {}
function pspell_config_create(string $language, string $spelling = "", string $jargon = "", string $encoding = "") {}
/**
* Consider run-together words as valid compounds

View File

@ -13,13 +13,13 @@ use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable;
* @param string $service [optional] <p>
* The service to connect to. If service is a name, it is translated to the corresponding port number.
* </p>
* @param array $hints [optional] <p>
* @param array $hints <p>
* Hints provide criteria for selecting addresses returned. You may specify the hints as defined by getadrinfo.
* </p>
* @return AddressInfo[]|false of AddrInfo resource handles that can be used with the other socket_addrinfo functions.
* @since 7.2
*/
function socket_addrinfo_lookup(string $host, ?string $service, array $hints): array|false {}
function socket_addrinfo_lookup(string $host, ?string $service, array $hints = []): array|false {}
/**
* Create a Socket resource, and connect it to the provided AddrInfo resource.<br/>
@ -389,7 +389,7 @@ function socket_close(Socket $socket): void {}
* @param string $data <p>
* The buffer to be written.
* </p>
* @param int|null $length [optional] <p>
* @param int|null $length <p>
* The optional parameter <i>length</i> can specify an
* alternate length of bytes written to the socket. If this length is
* greater than the buffer length, it is silently truncated to the length
@ -407,7 +407,7 @@ function socket_close(Socket $socket): void {}
* === operator to check for <b>FALSE</b> in case of an
* error.
*/
function socket_write(Socket $socket, string $data, ?int $length = 0): int|false {}
function socket_write(Socket $socket, string $data, ?int $length = null): int|false {}
/**
* Reads a maximum of length bytes from a socket
@ -517,7 +517,7 @@ function socket_getpeername(Socket $socket, &$address, &$port = null): bool {}
* or the pathname of a Unix domain socket, if the socket family is
* <b>AF_UNIX</b>.
* </p>
* @param int|null $port [optional] <p>
* @param int|null $port <p>
* The <i>port</i> parameter is only used and is mandatory
* when connecting to an <b>AF_INET</b> or an
* <b>AF_INET6</b> socket, and designates
@ -532,7 +532,7 @@ function socket_getpeername(Socket $socket, &$address, &$port = null): bool {}
* If the socket is non-blocking then this function returns <b>FALSE</b> with an
* error Operation now in progress.
*/
function socket_connect(Socket $socket, string $address, ?int $port = 0): bool {}
function socket_connect(Socket $socket, string $address, ?int $port = null): bool {}
/**
* Return a string describing a socket error
@ -849,14 +849,14 @@ function socket_recvmsg(
* @param string $address <p>
* IP address of the remote host.
* </p>
* @param int|null $port [optional] <p>
* @param int|null $port <p>
* <i>port</i> is the remote port number at which the data
* will be sent.
* </p>
* @return int|false <b>socket_sendto</b> returns the number of bytes sent to the
* remote host, or <b>FALSE</b> if an error occurred.
*/
function socket_sendto(Socket $socket, string $data, int $length, int $flags, string $address, ?int $port = 0): int|false {}
function socket_sendto(Socket $socket, string $data, int $length, int $flags, string $address, ?int $port = null): int|false {}
/**
* Gets socket options for the socket

View File

@ -947,12 +947,12 @@ function sodium_compare(string $string1, string $string2): int {}
* Convert from hex without side-chanels
* @link https://www.php.net/manual/en/function.sodium-hex2bin.php
* @param string $string
* @param string $ignore [optional]
* @param string $ignore
* @return string
* @throws SodiumException
* @since 7.2
*/
function sodium_hex2bin(string $string, string $ignore): string {}
function sodium_hex2bin(string $string, string $ignore = ''): string {}
/**
* Increment a string in little-endian

View File

@ -35,7 +35,7 @@ function hex2bin(string $string): string|false {};
/**
* Get or Set the HTTP response code
* @param int $response_code [optional] The optional response_code will set the response code.
* @param int $response_code The optional response_code will set the response code.
* @return int|bool The current response code. By default the return value is int(200).
*/
function http_response_code(int $response_code): int|bool {}
function http_response_code(int $response_code = 0): int|bool {}

View File

@ -409,7 +409,7 @@ function wordwrap(string $string, int $width = 75, string $break = "\n", bool $c
* </tbody>
*
* </table>
* @param string|null $encoding [optional] <p>
* @param string|null $encoding <p>
* Defines encoding used in conversion.
* If omitted, the default value for this argument is ISO-8859-1 in
* versions of PHP prior to 5.4.0, and UTF-8 from PHP 5.4.0 onwards.
@ -431,7 +431,7 @@ function wordwrap(string $string, int $width = 75, string $break = "\n", bool $c
* @return string The converted string.
*/
#[Pure]
function htmlspecialchars(string $string, int $flags = ENT_QUOTES|ENT_SUBSTITUTE, ?string $encoding = 'UTF-8', bool $double_encode = true): string {}
function htmlspecialchars(string $string, int $flags = ENT_QUOTES|ENT_SUBSTITUTE, ?string $encoding = null, bool $double_encode = true): string {}
/**
* Convert all applicable characters to HTML entities
@ -557,7 +557,7 @@ function htmlspecialchars_decode(string $string, int $flags = ENT_QUOTES|ENT_SUB
/**
* Returns the translation table used by <function>htmlspecialchars</function> and <function>htmlentities</function>
* @link https://php.net/manual/en/function.get-html-translation-table.php
* @param int $table [optional] <p>
* @param int $table <p>
* There are two new constants (HTML_ENTITIES,
* HTML_SPECIALCHARS) that allow you to specify the
* table you want.
@ -728,7 +728,7 @@ function htmlspecialchars_decode(string $string, int $flags = ENT_QUOTES|ENT_SUB
* @return array the translation table as an array.
*/
#[Pure]
function get_html_translation_table(int $table, int $flags = ENT_QUOTES|ENT_SUBSTITUTE, string $encoding = "UTF-8"): array {}
function get_html_translation_table(int $table = 0, int $flags = ENT_QUOTES|ENT_SUBSTITUTE, string $encoding = "UTF-8"): array {}
/**
* Calculate the sha1 hash of a string
@ -827,14 +827,14 @@ function iptcparse(string $iptc_block): array|false {}
* @param string $filename <p>
* Path to the JPEG image.
* </p>
* @param int $spool [optional] <p>
* @param int $spool <p>
* Spool flag. If the spool flag is over 2 then the JPEG will be
* returned as a string.
* </p>
* @return string|bool If success and spool flag is lower than 2 then the JPEG will not be
* returned as a string, false on errors.
*/
function iptcembed(string $iptc_data, string $filename, int $spool): string|bool {}
function iptcembed(string $iptc_data, string $filename, int $spool = 0): string|bool {}
/**
* Get the size of an image
@ -1293,7 +1293,7 @@ function strnatcasecmp(string $string1, string $string2): int {}
* @param string $needle <p>
* The substring to search for
* </p>
* @param int $offset [optional] <p>
* @param int $offset <p>
* The offset where to start counting
* </p>
* @param int|null $length [optional] <p>
@ -1304,7 +1304,7 @@ function strnatcasecmp(string $string1, string $string2): int {}
* @return int This functions returns an integer.
*/
#[Pure]
function substr_count(string $haystack, string $needle, int $offset, ?int $length): int {}
function substr_count(string $haystack, string $needle, int $offset = 0, ?int $length): int {}
/**
* Finds the length of the initial segment of a string consisting
@ -1316,7 +1316,7 @@ function substr_count(string $haystack, string $needle, int $offset, ?int $lengt
* @param string $characters <p>
* The list of allowable characters to include in counted segments.
* </p>
* @param int $offset [optional] <p>
* @param int $offset <p>
* The position in subject to
* start searching.
* </p>
@ -1357,7 +1357,7 @@ function substr_count(string $haystack, string $needle, int $offset, ?int $lengt
* which consists entirely of characters in str2.
*/
#[Pure]
function strspn(string $string, string $characters, int $offset, ?int $length): int {}
function strspn(string $string, string $characters, int $offset = 0, ?int $length): int {}
/**
* Find length of initial segment not matching mask
@ -1368,7 +1368,7 @@ function strspn(string $string, string $characters, int $offset, ?int $length):
* @param string $characters <p>
* The second string.
* </p>
* @param int $offset [optional] <p>
* @param int $offset <p>
* The start position of the string to examine.
* </p>
* @param int|null $length [optional] <p>
@ -1377,7 +1377,7 @@ function strspn(string $string, string $characters, int $offset, ?int $length):
* @return int the length of the segment as an integer.
*/
#[Pure]
function strcspn(string $string, string $characters, int $offset, ?int $length): int {}
function strcspn(string $string, string $characters, int $offset = 0, ?int $length): int {}
/**
* Tokenize string

View File

@ -70,7 +70,7 @@ function strpos(string $haystack, string $needle, int $offset = 0): int|false {}
* If needle is not a string, it is converted to
* an integer and applied as the ordinal value of a character.
* </p>
* @param int $offset [optional] <p>
* @param int $offset <p>
* The optional offset parameter allows you
* to specify which character in haystack to
* start searching. The position returned is still relative to the
@ -80,7 +80,7 @@ function strpos(string $haystack, string $needle, int $offset = 0): int|false {}
* stripos will return boolean false.
*/
#[Pure]
function stripos(string $haystack, string $needle, int $offset): int|false {}
function stripos(string $haystack, string $needle, int $offset = 0): int|false {}
/**
* Find the position of the last occurrence of a substring in a string
@ -117,7 +117,7 @@ function strrpos(string $haystack, string $needle, int $offset = 0): int|false {
* Note that the needle may be a string of one or
* more characters.
* </p>
* @param int $offset [optional] <p>
* @param int $offset <p>
* The offset parameter may be specified to begin
* searching an arbitrary number of characters into the string.
* </p>
@ -134,7 +134,7 @@ function strrpos(string $haystack, string $needle, int $offset = 0): int|false {
* If needle is not found, false is returned.
*/
#[Pure]
function strripos(string $haystack, string $needle, int $offset): int|false {}
function strripos(string $haystack, string $needle, int $offset = 0): int|false {}
/**
* Reverse a string
@ -153,14 +153,14 @@ function strrev(string $string): string {}
* @param string $string <p>
* A Hebrew input string.
* </p>
* @param int $max_chars_per_line [optional] <p>
* @param int $max_chars_per_line <p>
* This optional parameter indicates maximum number of characters per
* line that will be returned.
* </p>
* @return string the visual string.
*/
#[Pure]
function hebrev(string $string, int $max_chars_per_line): string {}
function hebrev(string $string, int $max_chars_per_line = 0): string {}
/**
* Convert logical Hebrew text to visual text with newline conversion
@ -203,14 +203,14 @@ function nl2br(string $string, bool $use_xhtml = true): string {}
* (\) are used as directory separator character. In
* other environments, it is the forward slash (/).
* </p>
* @param string $suffix [optional] <p>
* @param string $suffix <p>
* If the filename ends in suffix this will also
* be cut off.
* </p>
* @return string the base name of the given path.
*/
#[Pure]
function basename(string $path, string $suffix): string {}
function basename(string $path, string $suffix = ''): string {}
/**
* Returns a parent directory's path
@ -840,7 +840,7 @@ function str_repeat(string $string, int $times): string {}
* @param string $string <p>
* The examined string.
* </p>
* @param int $mode [optional] <p>
* @param int $mode <p>
* See return values.
* </p>
* @return int[]|string Depending on mode
@ -855,7 +855,7 @@ function str_repeat(string $string, int $times): string {}
* 4 - a string containing all not used characters is returned.
*/
#[Pure]
function count_chars(string $string, int $mode): array|string {}
function count_chars(string $string, int $mode = 0): array|string {}
/**
* Split a string into smaller chunks

View File

@ -568,7 +568,7 @@ function rawurldecode(string $string): string {}
* This is meant to allow for legal variable names when the data is
* decoded by PHP or another CGI application later on.
* </p>
* @param string|null $arg_separator [optional] <p>
* @param string|null $arg_separator <p>
* arg_separator.output
* is used to separate arguments, unless this parameter is specified,
* and is then used.
@ -580,7 +580,7 @@ function rawurldecode(string $string): string {}
* @return string a URL-encoded string.
*/
#[Pure]
function http_build_query(object|array $data, string $numeric_prefix = "", ?string $arg_separator = "&", int $encoding_type = PHP_QUERY_RFC1738): string {}
function http_build_query(object|array $data, string $numeric_prefix = "", ?string $arg_separator = null, int $encoding_type = PHP_QUERY_RFC1738): string {}
/**
* Returns the target of a symbolic link
@ -928,12 +928,12 @@ function proc_nice(int $priority): bool {}
/**
* Generate a random integer
* @link https://php.net/manual/en/function.rand.php
* @param int $min [optional]
* @param int $min
* @param int $max [optional]
* @return int A pseudo random value between min
* (or 0) and max (or getrandmax, inclusive).
*/
function rand(int $min = 0, int $max): int {}
function rand(int $min = null, int $max): int {}
/**
* Seed the random number generator
@ -941,7 +941,7 @@ function rand(int $min = 0, int $max): int {}
* an alias of {@see mt_srand()}.
* </p>
* @link https://php.net/manual/en/function.srand.php
* @param int $seed [optional] <p>
* @param int $seed <p>
* Optional seed value
* </p>
* @param int $mode [optional] <p>
@ -950,7 +950,7 @@ function rand(int $min = 0, int $max): int {}
* @return void
*/
function srand(
int $seed,
int $seed = 0,
#[PhpStormStubsElementAvailable(from: '7.1')] int $mode = MT_RAND_MT19937
): void {}
@ -965,7 +965,7 @@ function getrandmax(): int {}
/**
* Generate a random value via the Mersenne Twister Random Number Generator
* @link https://php.net/manual/en/function.mt-rand.php
* @param int $min [optional] <p>
* @param int $min <p>
* Optional lowest value to be returned (default: 0)
* </p>
* @param int $max [optional] <p>
@ -974,12 +974,12 @@ function getrandmax(): int {}
* @return int A random integer value between min (or 0)
* and max (or mt_getrandmax, inclusive)
*/
function mt_rand(int $min = 0, int $max): int {}
function mt_rand(int $min = null, int $max): int {}
/**
* Seeds the Mersenne Twister Random Number Generator
* @link https://php.net/manual/en/function.mt-srand.php
* @param int $seed [optional] <p>
* @param int $seed <p>
* An optional seed value
* </p>
* @param int $mode [optional] <p>
@ -988,7 +988,7 @@ function mt_rand(int $min = 0, int $max): int {}
* @return void
*/
function mt_srand(
int $seed,
int $seed = 0,
#[PhpStormStubsElementAvailable(from: '7.1')] int $mode = MT_RAND_MT19937
): void {}

View File

@ -785,7 +785,7 @@ function putenv(string $assignment): bool {}
* For example, an option string "x" recognizes an
* option -x.
* Only a-z, A-Z and 0-9 are allowed.
* @param array $long_options [optional] An array of options. Each element in this array will be used as option
* @param array $long_options An array of options. Each element in this array will be used as option
* strings and matched against options passed to the script starting with
* two hyphens (--).
* For example, an longopts element "opt" recognizes an
@ -797,7 +797,7 @@ function putenv(string $assignment): bool {}
*/
function getopt(
string $short_options,
array $long_options,
array $long_options = [],
#[PhpStormStubsElementAvailable(from: '7.1')] &$rest_index
): array|false {}
@ -853,7 +853,7 @@ function gettimeofday(#[TypeContract(true: "float", false: "int[]")] bool $as_fl
/**
* Gets the current resource usages
* @link https://php.net/manual/en/function.getrusage.php
* @param int $mode [optional] <p>
* @param int $mode <p>
* If who is 1, getrusage will be called with
* RUSAGE_CHILDREN.
* </p>
@ -861,7 +861,7 @@ function gettimeofday(#[TypeContract(true: "float", false: "int[]")] bool $as_fl
* call. All entries are accessible by using their documented field names.
*/
#[Pure(true)]
function getrusage(int $mode): array|false {}
function getrusage(int $mode = 0): array|false {}
/**
* Generate a unique ID
@ -1041,7 +1041,7 @@ function import_request_variables(string $types, $prefix = null): bool {}
* @param string $message <p>
* The error message that should be logged.
* </p>
* @param int $message_type [optional] <p>
* @param int $message_type <p>
* Says where the error should go. The possible message types are as
* follows:
* </p>
@ -1101,4 +1101,4 @@ function import_request_variables(string $types, $prefix = null): bool {}
* </p>
* @return bool true on success or false on failure.
*/
function error_log(string $message, int $message_type, ?string $destination, ?string $additional_headers): bool {}
function error_log(string $message, int $message_type = 0, ?string $destination, ?string $additional_headers): bool {}

View File

@ -676,12 +676,12 @@ function setrawcookie(string $name, $value = '', array $options = []): bool {}
* but if you pass in false as the second argument you can force
* multiple headers of the same type. For example:
* </p>
* @param int $response_code [optional] <p>
* @param int $response_code <p>
* Forces the HTTP response code to the specified value.
* </p>
* @return void
*/
function header(string $header, bool $replace = true, int $response_code): void {}
function header(string $header, bool $replace = true, int $response_code = 0): void {}
/**
* Remove previously set headers

View File

@ -966,7 +966,7 @@ function tmpfile() {}
* @param string $filename <p>
* Path to the file.
* </p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* The optional parameter flags can be one, or
* more, of the following constants:
* FILE_USE_INCLUDE_PATH
@ -986,7 +986,7 @@ function tmpfile() {}
* </p>
*/
#[Pure(true)]
function file(string $filename, int $flags, $context): array|false {}
function file(string $filename, int $flags = 0, $context): array|false {}
/**
* Reads entire file into a string

View File

@ -205,7 +205,7 @@ function stream_context_set_default(array $options) {}
* @param string $filter_name <p>
* The filter name.
* </p>
* @param int $mode [optional] <p>
* @param int $mode <p>
* By default, stream_filter_prepend will
* attach the filter to the read filter chain
* if the file was opened for reading (i.e. File Mode:
@ -229,7 +229,7 @@ function stream_context_set_default(array $options) {}
* @return resource|false a resource which can be used to refer to this filter
* instance during a call to stream_filter_remove.
*/
function stream_filter_prepend($stream, string $filter_name, int $mode, mixed $params) {}
function stream_filter_prepend($stream, string $filter_name, int $mode = 0, mixed $params) {}
/**
* Attach a filter to a stream
@ -240,7 +240,7 @@ function stream_filter_prepend($stream, string $filter_name, int $mode, mixed $p
* @param string $filter_name <p>
* The filter name.
* </p>
* @param int $mode [optional] <p>
* @param int $mode <p>
* By default, stream_filter_append will
* attach the filter to the read filter chain
* if the file was opened for reading (i.e. File Mode:
@ -263,7 +263,7 @@ function stream_filter_prepend($stream, string $filter_name, int $mode, mixed $p
* @return resource|false a resource which can be used to refer to this filter
* instance during a call to stream_filter_remove.
*/
function stream_filter_append($stream, string $filter_name, int $mode, mixed $params) {}
function stream_filter_append($stream, string $filter_name, int $mode = 0, mixed $params) {}
/**
* Remove a filter from a stream
@ -410,7 +410,7 @@ function stream_socket_get_name($socket, bool $remote): string|false {}
* @param int $length <p>
* The number of bytes to receive from the socket.
* </p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* The value of flags can be any combination
* of the following:
* <table>
@ -438,7 +438,7 @@ function stream_socket_get_name($socket, bool $remote): string|false {}
* </p>
* @return string|false the read data, as a string, or false on error
*/
function stream_socket_recvfrom($socket, int $length, int $flags, &$address): string|false {}
function stream_socket_recvfrom($socket, int $length, int $flags = 0, &$address): string|false {}
/**
* Sends a message to a socket, whether it is connected or not
@ -449,7 +449,7 @@ function stream_socket_recvfrom($socket, int $length, int $flags, &$address): st
* @param string $data <p>
* The data to be sent.
* </p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* The value of flags can be any combination
* of the following:
* <table>
@ -462,7 +462,7 @@ function stream_socket_recvfrom($socket, int $length, int $flags, &$address): st
* </tr>
* </table>
* </p>
* @param string $address [optional] <p>
* @param string $address <p>
* The address specified when the socket stream was created will be used
* unless an alternate address is specified in address.
* </p>
@ -471,7 +471,7 @@ function stream_socket_recvfrom($socket, int $length, int $flags, &$address): st
* </p>
* @return int|false a result code, as an integer.
*/
function stream_socket_sendto($socket, string $data, int $flags, string $address): int|false {}
function stream_socket_sendto($socket, string $data, int $flags = 0, string $address = ''): int|false {}
/**
* Turns encryption on/off on an already connected socket
@ -554,12 +554,12 @@ function stream_socket_pair(int $domain, int $type, int $protocol): array|false
* @param int|null $length [optional] <p>
* Maximum bytes to copy
* </p>
* @param int $offset [optional] <p>
* @param int $offset <p>
* The offset where to start to copy data
* </p>
* @return int|false the total count of bytes copied, or false on failure.
*/
function stream_copy_to_stream($from, $to, ?int $length, int $offset): int|false {}
function stream_copy_to_stream($from, $to, ?int $length, int $offset = 0): int|false {}
/**
* Reads remainder of a stream into a string
@ -567,7 +567,7 @@ function stream_copy_to_stream($from, $to, ?int $length, int $offset): int|false
* @param resource $stream <p>
* A stream resource (e.g. returned from fopen)
* </p>
* @param int|null $length [optional] <p>
* @param int|null $length <p>
* The maximum bytes to read. Defaults to -1 (read all the remaining
* buffer).
* </p>
@ -576,7 +576,7 @@ function stream_copy_to_stream($from, $to, ?int $length, int $offset): int|false
* </p>
* @return string|false a string or false on failure.
*/
function stream_get_contents($stream, ?int $length = -1, int $offset = -1): string|false {}
function stream_get_contents($stream, ?int $length = null, int $offset = -1): string|false {}
/**
* Tells whether the stream supports locking.
@ -596,7 +596,7 @@ function stream_supports_lock($stream): bool {}
* fopen, popen, or
* fsockopen.
* </p>
* @param int|null $length [optional] <p>
* @param int|null $length <p>
* Must be greater than the longest line (in characters) to be found in
* the CSV file (allowing for trailing line-end characters). It became
* optional in PHP 5. Omitting this parameter (or setting it to 0 in PHP
@ -625,7 +625,7 @@ function stream_supports_lock($stream): bool {}
* </p>
*/
#[LanguageLevelTypeAware(['8.0' => 'array|false'], default: 'array|false|null')]
function fgetcsv($stream, ?int $length = 0, string $separator = ',', string $enclosure = '"', string $escape = '\\') {}
function fgetcsv($stream, ?int $length = null, string $separator = ',', string $enclosure = '"', string $escape = '\\') {}
/**
* Format line as CSV and write to file pointer
@ -896,7 +896,7 @@ function stream_get_meta_data($stream): array {}
* @param int $length <p>
* The number of bytes to read from the handle.
* </p>
* @param string $ending [optional] <p>
* @param string $ending <p>
* An optional string delimiter.
* </p>
* @return string|false a string of up to length bytes read from the file
@ -905,7 +905,7 @@ function stream_get_meta_data($stream): array {}
* If an error occurs, returns false.
* </p>
*/
function stream_get_line($stream, int $length, string $ending): string|false {}
function stream_get_line($stream, int $length, string $ending = ''): string|false {}
/**
* Register a URL wrapper implemented as a PHP class
@ -916,7 +916,7 @@ function stream_get_line($stream, int $length, string $ending): string|false {}
* @param string $class <p>
* The classname which implements the protocol.
* </p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* Should be set to STREAM_IS_URL if
* protocol is a URL protocol. Default is 0, local
* stream.
@ -927,7 +927,7 @@ function stream_get_line($stream, int $length, string $ending): string|false {}
* protocol already has a handler.
* </p>
*/
function stream_wrapper_register(string $protocol, string $class, int $flags): bool {}
function stream_wrapper_register(string $protocol, string $class, int $flags = 0): bool {}
/**
* Alias:
@ -1040,12 +1040,12 @@ function get_headers(
* @param int $seconds <p>
* The seconds part of the timeout to be set.
* </p>
* @param int $microseconds [optional] <p>
* @param int $microseconds <p>
* The microseconds part of the timeout to be set.
* </p>
* @return bool true on success or false on failure.
*/
function stream_set_timeout($stream, int $seconds, int $microseconds): bool {}
function stream_set_timeout($stream, int $seconds, int $microseconds = 0): bool {}
/**
* Alias:
@ -1165,7 +1165,7 @@ function realpath(string $path): string|false {}
* frontend search expression input may be way more convenient for
* non-programming users.
* </p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* The value of flags can be any combination of
* the following flags, joined with the
* binary OR (|) operator.
@ -1204,4 +1204,4 @@ function realpath(string $path): string|false {}
* @return bool true if there is a match, false otherwise.
*/
#[Pure(true)]
function fnmatch(string $pattern, string $filename, int $flags): bool {}
function fnmatch(string $pattern, string $filename, int $flags = 0): bool {}

View File

@ -412,7 +412,7 @@ function getdir(string $directory, $context = null): Directory|false {}
* @param string $directory <p>
* The directory that will be scanned.
* </p>
* @param int $sorting_order [optional] <p>
* @param int $sorting_order <p>
* By default, the sorted order is alphabetical in ascending order. If
* the optional sorting_order is set to non-zero,
* then the sort order is alphabetical in descending order.
@ -427,7 +427,7 @@ function getdir(string $directory, $context = null): Directory|false {}
* boolean false is returned, and an error of level
* E_WARNING is generated.
*/
function scandir(string $directory, int $sorting_order, $context): array|false {}
function scandir(string $directory, int $sorting_order = 0, $context): array|false {}
/**
* Find pathnames matching a pattern
@ -435,7 +435,7 @@ function scandir(string $directory, int $sorting_order, $context): array|false {
* @param string $pattern <p>
* The pattern. No tilde expansion or parameter substitution is done.
* </p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* Valid flags:
* GLOB_MARK - Adds a slash to each directory returned
* GLOB_NOSORT - Return files as they appear in the directory (no sorting). When this flag is not used, the pathnames are sorted alphabetically
@ -452,7 +452,7 @@ function scandir(string $directory, int $sorting_order, $context): array|false {
* error.</p>
*/
#[Pure(true)]
function glob(string $pattern, int $flags): array|false {}
function glob(string $pattern, int $flags = 0): array|false {}
/**
* Gets last access time of file
@ -909,13 +909,13 @@ function touch(string $filename, ?int $mtime, ?int $atime): bool {}
* @param bool $clear_realpath_cache [optional] <p>
* Whenever to clear realpath cache or not.
* </p>
* @param string $filename [optional] <p>
* @param string $filename <p>
* Clear realpath cache on a specific filename, only used if
* clear_realpath_cache is true.
* </p>
* @return void
*/
function clearstatcache(bool $clear_realpath_cache = false, string $filename): void {}
function clearstatcache(bool $clear_realpath_cache = false, string $filename = ''): void {}
/**
* Returns the total size of a filesystem or disk partition
@ -994,7 +994,7 @@ function diskfreespace(string $directory): float|false {}
* $text = str_replace("\n.", "\n..", $text);
* ?>
* </pre>
* @param string|array $additional_headers [optional] <p>
* @param string|array $additional_headers <p>
* String or array to be inserted at the end of the email header.<br/>
* Since 7.2.0 accepts an array. Its keys are the header names and its values are the respective header values.
* </p>
@ -1022,7 +1022,7 @@ function diskfreespace(string $directory): float|false {}
* This should be a last resort, as it does not comply with
* RFC 2822.
* </p>
* @param string $additional_params [optional] <p>
* @param string $additional_params <p>
* The additional_parameters parameter
* can be used to pass additional flags as command line options to the
* program configured to be used when sending mail, as defined by the
@ -1042,7 +1042,7 @@ function diskfreespace(string $directory): float|false {}
* it does NOT mean the mail will actually reach the intended destination.
* </p>
*/
function mail(string $to, string $subject, string $message, array|string $additional_headers, string $additional_params): bool {}
function mail(string $to, string $subject, string $message, array|string $additional_headers = [], string $additional_params = ''): bool {}
/**
* Calculate the hash value needed by EZMLM

View File

@ -196,7 +196,7 @@ function metaphone(string $string, int $max_phonemes = 0): false|string {}
* what type of content encoding the browser will accept and will return
* its output accordingly.
* </p>
* @param int $chunk_size [optional] <p>
* @param int $chunk_size <p>
* If the optional parameter chunk_size is passed, the
* buffer will be flushed after any output call which causes the buffer's
* length to equal or exceed chunk_size.
@ -210,7 +210,7 @@ function metaphone(string $string, int $max_phonemes = 0): false|string {}
* </p>
* @return bool true on success or false on failure.
*/
function ob_start($callback, int $chunk_size, int $flags = PHP_OUTPUT_HANDLER_STDFLAGS): bool {}
function ob_start($callback, int $chunk_size = 0, int $flags = PHP_OUTPUT_HANDLER_STDFLAGS): bool {}
/**
* Flush (send) the output buffer
@ -383,14 +383,14 @@ function ob_list_handlers(): array {}
* @param array &$array <p>
* The input array.
* </p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* You may modify the behavior of the sort using the optional
* parameter sort_flags, for details
* see sort.
* </p>
* @return bool true on success or false on failure.
*/
function ksort(array &$array, int $flags): bool {}
function ksort(array &$array, int $flags = SORT_REGULAR): bool {}
/**
* Sort an array by key in reverse order
@ -398,14 +398,14 @@ function ksort(array &$array, int $flags): bool {}
* @param array &$array <p>
* The input array.
* </p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* You may modify the behavior of the sort using the optional parameter
* sort_flags, for details see
* sort.
* </p>
* @return bool true on success or false on failure.
*/
function krsort(array &$array, int $flags): bool {}
function krsort(array &$array, int $flags = SORT_REGULAR): bool {}
/**
* Sort an array using a "natural order" algorithm
@ -433,14 +433,14 @@ function natcasesort(array &$array): bool {}
* @param array &$array <p>
* The input array.
* </p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* You may modify the behavior of the sort using the optional
* parameter sort_flags, for details
* see sort.
* </p>
* @return bool true on success or false on failure.
*/
function asort(array &$array, int $flags): bool {}
function asort(array &$array, int $flags = SORT_REGULAR): bool {}
/**
* Sort an array in reverse order and maintain index association
@ -448,14 +448,14 @@ function asort(array &$array, int $flags): bool {}
* @param array &$array <p>
* The input array.
* </p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* You may modify the behavior of the sort using the optional parameter
* sort_flags, for details see
* sort.
* </p>
* @return bool true on success or false on failure.
*/
function arsort(array &$array, int $flags): bool {}
function arsort(array &$array, int $flags = SORT_REGULAR): bool {}
/**
* Sort an array
@ -463,7 +463,7 @@ function arsort(array &$array, int $flags): bool {}
* @param array &$array <p>
* The input array.
* </p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* The optional second parameter sort_flags
* may be used to modify the sorting behavior using these values.
* </p>
@ -473,7 +473,7 @@ function arsort(array &$array, int $flags): bool {}
* (don't change types)</p>
* @return bool true on success or false on failure.
*/
function sort(array &$array, int $flags): bool {}
function sort(array &$array, int $flags = SORT_REGULAR): bool {}
/**
* Sort an array in reverse order
@ -481,14 +481,14 @@ function sort(array &$array, int $flags): bool {}
* @param array &$array <p>
* The input array.
* </p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* You may modify the behavior of the sort using the optional
* parameter sort_flags, for details see
* sort.
* </p>
* @return bool true on success or false on failure.
*/
function rsort(array &$array, int $flags): bool {}
function rsort(array &$array, int $flags = SORT_REGULAR): bool {}
/**
* Sort an array by values using a user-defined comparison function
@ -822,13 +822,13 @@ function array_search(mixed $needle, array $haystack, bool $strict = false): str
* imported into the symbol table. Prefixes are automatically separated from
* the array key by an underscore character.
* </p>
* @param int $flags [optional] <p>
* @param int $flags <p>
* The way invalid/numeric keys and collisions are treated is determined
* by the extract_type. It can be one of the
* following values:
* EXTR_OVERWRITE
* If there is a collision, overwrite the existing variable.</p>
* @param string $prefix [optional] <p>Only overwrite the variable if it already exists in the
* @param string $prefix <p>Only overwrite the variable if it already exists in the
* current symbol table, otherwise do nothing. This is useful
* for defining a list of valid variables and then extracting
* only those variables you have defined out of
@ -846,8 +846,8 @@ function extract(
EXTR_PREFIX_INVALID,
EXTR_PREFIX_IF_EXISTS,
EXTR_REFS
])] int $flags,
string $prefix
])] int $flags = EXTR_OVERWRITE,
string $prefix = ""
): int {}
/**
@ -1025,7 +1025,7 @@ function array_unshift(array &$array, #[PhpStormStubsElementAvailable(from: '5.3
* count($input) for
* length.
* </p>
* @param mixed $replacement [optional] <p>
* @param mixed $replacement <p>
* If replacement array is specified, then the
* removed elements are replaced with elements from this array.
* </p>
@ -1043,7 +1043,7 @@ function array_unshift(array &$array, #[PhpStormStubsElementAvailable(from: '5.3
* </p>
* @return array the array consisting of the extracted elements.
*/
function array_splice(array &$array, int $offset, ?int $length, mixed $replacement): array {}
function array_splice(array &$array, int $offset, ?int $length, mixed $replacement = []): array {}
/**
* Extract a slice of the array

View File

@ -211,7 +211,7 @@ function array_flip(array $array): array {}
* @param array $array <p>
* The array to work on
* </p>
* @param int $case [optional] <p>
* @param int $case <p>
* Either CASE_UPPER or
* CASE_LOWER (default)
* </p>
@ -219,7 +219,7 @@ function array_flip(array $array): array {}
* @meta
*/
#[Pure]
function array_change_key_case(array $array, int $case): array {}
function array_change_key_case(array $array, int $case = CASE_LOWER): array {}
/**
* Pick one or more random keys out of an array
@ -887,7 +887,7 @@ function key_exists($key, array $array): bool {}
*/
function assert(
mixed $assertion,
#[LanguageLevelTypeAware(['8.0' => 'Throwable|string|null'], default: 'string')] $description = ''
#[LanguageLevelTypeAware(['8.0' => 'Throwable|string|null'], default: 'string')] $description = null
): bool {}
/**

View File

@ -47,7 +47,7 @@ class StubsConstantsAndParametersValuesTest extends BaseStubsTest
$reflectionValue,
$stubValue,
sprintf(
'Reflection function %s has optional parameter %s with default value %s but stub parameter has value %s',
'Reflection function %s has optional parameter %s with default value "%s" but stub parameter has value "%s"',
$function->name,
$parameter->name,
$reflectionValue,

View File

@ -72,12 +72,12 @@ function gzgetc($stream): string|false {}
* The gz-file pointer. It must be valid, and must point to a file
* successfully opened by <b>gzopen</b>.
* </p>
* @param int|null $length [optional] <p>
* @param int|null $length <p>
* The length of data to get.
* </p>
* @return string|false The uncompressed string, or <b>FALSE</b> on error.
*/
function gzgets($stream, ?int $length = 1024): string|false {}
function gzgets($stream, ?int $length = null): string|false {}
/**
* Get line from gz-file pointer and strip HTML tags
@ -354,14 +354,14 @@ function gzencode(string $data, int $level = -1, int $encoding = FORCE_GZIP): st
* @param string $data <p>
* The data to decode, encoded by <b>gzencode</b>.
* </p>
* @param int $max_length [optional] <p>
* @param int $max_length <p>
* The maximum length of data to decode.
* </p>
* @return string|false The decoded string, or <b>FALSE</b> if an error occurred.
* @since 5.4
*/
#[Pure]
function gzdecode(string $data, int $max_length): string|false {}
function gzdecode(string $data, int $max_length = 0): string|false {}
/**
* Compress data with the specified encoding
@ -383,13 +383,13 @@ function zlib_encode(string $data, int $encoding, int $level = -1): string|false
* @link https://php.net/manual/en/function.zlib-decode.php
* @param string $data <p>
* </p>
* @param int $max_length [optional] <p>
* @param int $max_length <p>
* </p>
* @return string|false
* @since 5.4
*/
#[Pure]
function zlib_decode(string $data, int $max_length): string|false {}
function zlib_decode(string $data, int $max_length = 0): string|false {}
/**
* Returns the coding type used for output compression