Add proper nullability

This commit is contained in:
Maxim.Kolmakov 2020-11-19 13:20:31 +01:00
parent 049ddb12a0
commit c433ad857b
42 changed files with 556 additions and 541 deletions

View File

@ -195,7 +195,7 @@ function each (array &$array): array
/**
* Sets which PHP errors are reported
* @link https://php.net/manual/en/function.error-reporting.php
* @param int $error_level [optional] <p>
* @param int|null $error_level [optional] <p>
* The new error_reporting
* level. It takes on either a bitmask, or named constants. Using named
* constants is strongly encouraged to ensure compatibility for future
@ -314,7 +314,7 @@ function each (array &$array): array
* level or the current level if no <i>level</i> parameter is
* given.
*/
function error_reporting (int $error_level): int
function error_reporting (?int $error_level): int
{}
/**
@ -646,7 +646,7 @@ function user_error (string $message, int $error_level = E_USER_NOTICE): bool
/**
* Sets a user-defined error handler function
* @link https://php.net/manual/en/function.set-error-handler.php
* @param callable $callback <p>
* @param callable|null $callback <p>
* The user function needs to accept two parameters: the error code, and a
* string describing the error. Then there are three optional parameters
* that may be supplied: the filename in which the error occurred, the
@ -664,20 +664,20 @@ function user_error (string $message, int $error_level = E_USER_NOTICE): bool
* <i>errno</i>
* The first parameter, <i>errno</i>, contains the
* level of the error raised, as an integer.
* @param int|string $error_levels [optional] <p>
* @param int $error_levels [optional] <p>
* Can be used to mask the triggering of the
* <i>error_handler</i> function just like the error_reporting ini setting
* controls which errors are shown. Without this mask set the
* <i>error_handler</i> will be called for every error
* regardless to the setting of the error_reporting setting.
* </p>
* @return callable|null a string containing the previously defined error handler (if any). If
* @return void a string containing the previously defined error handler (if any). If
* the built-in error handler is used null is returned. null is also returned
* in case of an error such as an invalid callback. If the previous error handler
* was a class method, this function will return an indexed array with the class
* and the method name.
*/
function set_error_handler (callable $callback, int $error_levels = E_ALL | E_STRICT)
function set_error_handler (?callable $callback, int $error_levels = E_ALL | E_STRICT)
{}
/**
@ -691,7 +691,7 @@ function restore_error_handler (): bool
/**
* Sets a user-defined exception handler function
* @link https://php.net/manual/en/function.set-exception-handler.php
* @param callable $callback <p>
* @param callable|null $callback <p>
* Name of the function to be called when an uncaught exception occurs.
* This function must be defined before calling
* <b>set_exception_handler</b>. This handler function
@ -699,10 +699,10 @@ function restore_error_handler (): bool
* was thrown.
* NULL may be passed instead, to reset this handler to its default state.
* </p>
* @return callable|null the name of the previously defined exception handler, or null on error. If
* @return void the name of the previously defined exception handler, or null on error. If
* no previous handler was defined, null is also returned.
*/
function set_exception_handler (callable $callback)
function set_exception_handler (?callable $callback)
{}
/**
@ -1109,7 +1109,7 @@ function gc_mem_caches (): int
/**
* Returns active resources
* @link https://php.net/manual/en/function.get-resources.php
* @param string $type [optional]<p>
* @param string|null $type [optional]<p>
*
* If defined, this will cause get_resources() to only return resources of the given type. A list of resource types is available.
*
@ -1121,5 +1121,5 @@ function gc_mem_caches (): int
* @since 7.0
*/
#[Pure]
function get_resources (string $type): array
function get_resources (?string $type): array
{}

View File

@ -18,7 +18,7 @@ function spl_classes (): array
* @link https://php.net/manual/en/function.spl-autoload.php
* @param string $class <p>
* </p>
* @param string $file_extensions [optional] <p>
* @param string|null $file_extensions [optional] <p>
* By default it checks all include paths to
* contain filenames built up by the lowercase class name appended by the
* filename extensions .inc and .php.
@ -26,13 +26,13 @@ function spl_classes (): array
* @return void
* @since 5.1.2
*/
function spl_autoload (string $class, string $file_extensions): void
function spl_autoload (string $class, ?string $file_extensions): void
{}
/**
* Register and return default file extensions for spl_autoload
* @link https://php.net/manual/en/function.spl-autoload-extensions.php
* @param string $file_extensions [optional] <p>
* @param string|null $file_extensions [optional] <p>
* When calling without an argument, it simply returns the current list
* of extensions each separated by comma. To modify the list of file
* extensions, simply invoke the functions with the new list of file
@ -43,13 +43,13 @@ function spl_autoload (string $class, string $file_extensions): void
* spl_autoload.
* @since 5.1.2
*/
function spl_autoload_extensions (string $file_extensions): string
function spl_autoload_extensions (?string $file_extensions): string
{}
/**
* Register given function as __autoload() implementation
* @link https://php.net/manual/en/function.spl-autoload-register.php
* @param callback $callback [optional] <p>
* @param callback|null $callback [optional] <p>
* The autoload function being registered.
* If no parameter is provided, then the default implementation of
* spl_autoload will be registered.
@ -62,7 +62,7 @@ function spl_autoload_extensions (string $file_extensions): string
* @throws TypeError Since 8.0.
* @since 5.1.2
*/
function spl_autoload_register (callable $callback, bool $throw = true, bool $prepend = false): bool
function spl_autoload_register (?callable $callback, bool $throw = true, bool $prepend = false): bool
{}
/**
@ -182,12 +182,12 @@ function iterator_count (Traversable $iterator): int
* The function must return true in order to
* continue iterating over the iterator.
* </p>
* @param array $args [optional] <p>
* @param array|null $args [optional] <p>
* Arguments to pass to the callback function.
* </p>
* @return int the iteration count.
*/
function iterator_apply (Traversable $iterator, callable $callback, array $args): int
function iterator_apply (Traversable $iterator, callable $callback, ?array $args): int
{}
// End of SPL v.0.2

View File

@ -398,7 +398,7 @@ class SimpleXMLIterator extends SimpleXMLElement implements RecursiveIterator, C
* urlencode('b&#38;#38;c'))). Since PHP 5.1.0 you don't need to do
* this because PHP will do it for you.
* </p>
* @param string $class_name [optional] <p>
* @param string|null $class_name [optional] <p>
* You may use this optional parameter so that
* <b>simplexml_load_file</b> will return an object of
* the specified class. That class should extend the
@ -418,7 +418,7 @@ class SimpleXMLIterator extends SimpleXMLElement implements RecursiveIterator, C
* @return SimpleXMLElement|false an object of class SimpleXMLElement with
* properties containing the data held within the XML document, or <b>FALSE</b> on failure.
*/
function simplexml_load_file (string $filename, string $class_name = "SimpleXMLElement", int $options = 0, string $namespace_or_prefix = "", bool $is_prefix = false): SimpleXMLElement|false {}
function simplexml_load_file (string $filename, ?string $class_name = "SimpleXMLElement", int $options = 0, string $namespace_or_prefix = "", bool $is_prefix = false): SimpleXMLElement|false {}
/**
* Interprets a string of XML into an object
@ -426,7 +426,7 @@ function simplexml_load_file (string $filename, string $class_name = "SimpleXMLE
* @param string $data <p>
* A well-formed XML string
* </p>
* @param string $class_name [optional] <p>
* @param string|null $class_name [optional] <p>
* You may use this optional parameter so that
* <b>simplexml_load_string</b> will return an object of
* the specified class. That class should extend the
@ -446,7 +446,7 @@ function simplexml_load_file (string $filename, string $class_name = "SimpleXMLE
* @return SimpleXMLElement|false an object of class SimpleXMLElement with
* properties containing the data held within the xml document, or <b>FALSE</b> on failure.
*/
function simplexml_load_string (string $data, string $class_name = "SimpleXMLElement", int $options = 0, string $namespace_or_prefix = "", bool $is_prefix = false): SimpleXMLElement|false {}
function simplexml_load_string (string $data, ?string $class_name = "SimpleXMLElement", int $options = 0, string $namespace_or_prefix = "", bool $is_prefix = false): SimpleXMLElement|false {}
/**
* Get a SimpleXMLElement object from a DOM node.
@ -454,14 +454,14 @@ function simplexml_load_string (string $data, string $class_name = "SimpleXMLEle
* @param DOMNode $node <p>
* A DOM Element node
* </p>
* @param string $class_name [optional] <p>
* @param string|null $class_name [optional] <p>
* You may use this optional parameter so that
* <b>simplexml_import_dom</b> will return an object of
* the specified class. That class should extend the
* SimpleXMLElement class.
* </p>
* @return SimpleXMLElement a SimpleXMLElement or <b>FALSE</b> on failure.
* @return SimpleXMLElement|null a SimpleXMLElement or <b>FALSE</b> on failure.
*/
function simplexml_import_dom (DOMNode $node, string $class_name = "SimpleXMLElement"): SimpleXMLElement {}
function simplexml_import_dom (DOMNode $node, ?string $class_name = "SimpleXMLElement"): ?SimpleXMLElement {}
// End of SimpleXML v.0.1

View File

@ -1,5 +1,6 @@
<?php
use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware;
use JetBrains\PhpStorm\Pure;
/**
@ -11,7 +12,7 @@ use JetBrains\PhpStorm\Pure;
* @param string $num2 <p>
* The right operand, as a string.
* </p>
* @param int $scale [optional] <p>
* @param int|null $scale [optional] <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
@ -20,7 +21,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 = 0): string
{}
/**
@ -32,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 $scale [optional] <p>
* @param int|null $scale [optional] <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
@ -41,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 = 0): string
{}
/**
@ -53,7 +54,7 @@ function bcsub (string $num1, string $num2, int $scale = 0): string
* @param string $num2 <p>
* The right operand, as a string.
* </p>
* @param int $scale [optional] <p>
* @param int|null $scale [optional] <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 +63,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 = 0): string
{}
/**
@ -74,7 +75,7 @@ function bcmul (string $num1, string $num2, int $scale = 0): string
* @param string $num2 <p>
* The divisor, as a string.
* </p>
* @param int $scale [optional] <p>
* @param int|null $scale [optional] <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
@ -84,7 +85,8 @@ function bcmul (string $num1, string $num2, int $scale = 0): string
* <i>divisor</i> is 0.
*/
#[Pure]
function bcdiv (string $num1, string $num2, int $scale = 0): ?string
#[LanguageLevelTypeAware(["8.0" => "string"], default: "?string")]
function bcdiv (string $num1, string $num2, ?int $scale = 0)
{}
/**
@ -96,7 +98,7 @@ function bcdiv (string $num1, string $num2, int $scale = 0): ?string
* @param string $num2 <p>
* The divisor, as a string. Since PHP 7.2, the divisor is no longer truncated to an integer.
* </p>
* @param int $scale [optional] <p>
* @param int|null $scale [optional] <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
@ -106,7 +108,8 @@ function bcdiv (string $num1, string $num2, int $scale = 0): ?string
* <i>divisor</i> is 0.
*/
#[Pure]
function bcmod (string $num1, string $num2, int $scale = 0): ?string
#[LanguageLevelTypeAware(["8.0" => "string"], default: "?string")]
function bcmod (string $num1, string $num2, ?int $scale = 0)
{}
/**
@ -120,7 +123,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 $scale [optional] <p>
* @param int|null $scale [optional] <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
@ -129,7 +132,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 = 0): string
{}
/**
@ -138,23 +141,24 @@ function bcpow (string $num, string $exponent, int $scale = 0): string
* @param string $num <p>
* The operand, as a string.
* </p>
* @param int $scale [optional]
* @param int|null $scale [optional]
* @return string|null the square root as a string, or <b>NULL</b> if
* <i>operand</i> is negative.
*/
#[Pure]
function bcsqrt (string $num, int $scale): ?string
#[LanguageLevelTypeAware(["8.0" => "string"], default: "?string")]
function bcsqrt (string $num, ?int $scale)
{}
/**
* Set default scale parameter for all bc math functions
* @link https://php.net/manual/en/function.bcscale.php
* @param int $scale <p>
* @param int|null $scale <p>
* The scale factor. Since 7.3.0 can be omitted.
* </p>
* @return int|true <b>INT</b> since 7.3.0 and <b>TRUE</b> before.
*/
function bcscale (int $scale): int
function bcscale (?int $scale): int
{}
/**
@ -166,7 +170,7 @@ function bcscale (int $scale): int
* @param string $num2 <p>
* The right operand, as a string.
* </p>
* @param int $scale [optional] <p>
* @param int|null $scale [optional] <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.
@ -176,7 +180,7 @@ function bcscale (int $scale): int
* <i>right_operand</i>, -1 otherwise.
*/
#[Pure]
function bccomp (string $num1, string $num2, int $scale = 0): int
function bccomp (string $num1, string $num2, ?int $scale = 0): int
{}
/**
@ -192,7 +196,7 @@ function bccomp (string $num1, string $num2, int $scale = 0): int
* @param string $modulus <p>
* The modulus, as an integral string (i.e. the scale has to be zero).
* </p>
* @param int $scale [optional] <p>
* @param int|null $scale [optional] <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
@ -202,5 +206,6 @@ function bccomp (string $num1, string $num2, int $scale = 0): int
* is 0 or <i>exponent</i> is negative.
*/
#[Pure]
function bcpowmod (string $num, string $exponent, string $modulus, int $scale = 0): ?string
#[LanguageLevelTypeAware(["8.0" => "string"], default: "?string")]
function bcpowmod (string $num, string $exponent, string $modulus, ?int $scale = 0)
{}

View File

@ -45,14 +45,14 @@ function bzread ($bz, int $length = 1024): string|false {}
* @param string $data <p>
* The written data.
* </p>
* @param int $length [optional] <p>
* @param int|null $length [optional] <p>
* If supplied, writing will stop after <i>length</i>
* (uncompressed) bytes have been written or the end of
* <i>data</i> is reached, whichever comes first.
* </p>
* @return int the number of bytes written, or <b>FALSE</b> on error.
*/
function bzwrite ($bz, string $data, int $length): int|false
function bzwrite ($bz, string $data, ?int $length): int|false
{}
/**

View File

@ -172,19 +172,19 @@ function jdmonthname (int $julian_day, int $mode): string
/**
* Get Unix timestamp for midnight on Easter of a given year
* @link https://php.net/manual/en/function.easter-date.php
* @param int $year [optional] <p>
* @param int|null $year [optional] <p>
* The year as a number between 1970 an 2037
* </p>
* @param int $mode [optional] Allows Easter dates to be calculated based on the Julian calendar when set to CAL_EASTER_ALWAYS_JULIAN
* @return int The easter date as a unix timestamp.
*/
function easter_date (int $year, int $mode = CAL_EASTER_DEFAULT): int
function easter_date (?int $year, int $mode = CAL_EASTER_DEFAULT): int
{}
/**
* Get number of days after March 21 on which Easter falls for a given year
* @link https://php.net/manual/en/function.easter-days.php
* @param int $year [optional] <p>
* @param int|null $year [optional] <p>
* The year as a positive number
* </p>
* @param int $mode [optional] <p>
@ -196,18 +196,18 @@ function easter_date (int $year, int $mode = CAL_EASTER_DEFAULT): int
* @return int The number of days after March 21st that the Easter Sunday
* is in the given <i>year</i>.
*/
function easter_days (int $year, int $mode = CAL_EASTER_DEFAULT): int
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 $timestamp [optional] defaults to time() <p>
* @param int|null $timestamp [optional] 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 = 0): int|false
{}
/**

View File

@ -79,7 +79,7 @@ class CURLFile {
/**
* Initialize a cURL session
* @link https://php.net/manual/en/function.curl-init.php
* @param string $url [optional] <p>
* @param string|null $url [optional] <p>
* If provided, the CURLOPT_URL option will be set
* to its value. You can manually set this using the
* curl_setopt function.
@ -87,7 +87,7 @@ class CURLFile {
* @return resource|false|CurlHandle a cURL handle on success, false on errors.
*/
#[LanguageLevelTypeAware(["8.0" => "CurlHandle|false"], default: "resource|false")]
function curl_init (string $url) {}
function curl_init (?string $url) {}
/**
* Copy a cURL handle along with all of its preferences
@ -2293,7 +2293,7 @@ function curl_exec (#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "
* Get information regarding a specific transfer
* @link https://php.net/manual/en/function.curl-getinfo.php
* @param CurlHandle|resource $handle
* @param int $option [optional] <p>
* @param int|null $option [optional] <p>
* This may be one of the following constants:
* CURLINFO_EFFECTIVE_URL - Last effective URL
* @return mixed If opt is given, returns its value as a string.
@ -2321,7 +2321,7 @@ function curl_exec (#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "
* "redirect_time"
*/
#[Pure]
function curl_getinfo (#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle, int $option): mixed
function curl_getinfo (#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle, ?int $option): mixed
{}
/**
@ -2366,14 +2366,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 $mime_type [optional] <p>Mimetype of the file.</p>
* @param string $posted_filename [optional] <p>Name of the file.</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>
* @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 = '', ?string $posted_filename = ''): CURLFile
{}
/**
@ -2543,7 +2543,7 @@ function curl_multi_exec (#[LanguageLevelTypeAware(["8.0" => "CurlMultiHandle"],
* @return string Return the content of a cURL handle if CURLOPT_RETURNTRANSFER is set.
*/
#[Pure]
function curl_multi_getcontent (#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $multi_handle): string
function curl_multi_getcontent (#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $multi_handle): ?string
{}
/**
@ -2590,11 +2590,11 @@ function curl_share_errno(#[LanguageLevelTypeAware(["8.0" => "CurlShareHandle"],
/**
* Return string describing the given error code
* @param int $error_code
* @return string
* @return string|null
* @since 7.1
*/
#[Pure]
function curl_share_strerror(int $error_code): string
function curl_share_strerror(int $error_code): ?string
{}
/**

View File

@ -12,7 +12,7 @@ use JetBrains\PhpStorm\Pure;
* The string to parse. Before PHP 5.0.0, microseconds weren't allowed in
* the time, since PHP 5.0.0 they are allowed but ignored.
* </p>
* @param int $baseTimestamp [optional] <p>
* @param int|null $baseTimestamp [optional] <p>
* Default value: now()
* The timestamp which is used as a base for the calculation of relative
* dates.
@ -21,7 +21,7 @@ use JetBrains\PhpStorm\Pure;
* this function would return -1 on failure.
*/
#[Pure]
function strtotime (string $datetime, int $baseTimestamp): int|false
function strtotime (string $datetime, ?int $baseTimestamp): int|false
{}
/**
@ -284,7 +284,7 @@ function strtotime (string $datetime, int $baseTimestamp): int|false
* date_format function with user based timestamps
* created with date_create.
* </p>
* @param int $timestamp [optional] Default value: now(). The optional timestamp parameter is an integer Unix timestamp
* @param int|null $timestamp [optional] Default value: now(). The optional timestamp parameter is an integer Unix timestamp
* that defaults to the current local time if a timestamp is not given.
* @return string|false a formatted date string. If a non-numeric value is used for
* timestamp, false is returned and an
@ -292,7 +292,7 @@ function strtotime (string $datetime, int $baseTimestamp): int|false
*/
#[Pure]
#[LanguageLevelTypeAware(["8.0" => "string"], default: "string|false")]
function date (string $format, int $timestamp)
function date (string $format, ?int $timestamp)
{}
/**
@ -380,7 +380,7 @@ function date (string $format, int $timestamp)
* </tr>
* </table>
* </p>
* @param int $timestamp [optional]
* @param int|null $timestamp [optional]
* @return int|false an integer.
* </p>
* <p>
@ -389,7 +389,7 @@ function date (string $format, int $timestamp)
* fewer digits than you would expect. See the example below.
*/
#[Pure]
function idate (string $format, int $timestamp): int|false
function idate (string $format, ?int $timestamp): int|false
{}
/**
@ -399,14 +399,14 @@ function idate (string $format, int $timestamp): int|false
* The format of the outputted date string. See the formatting
* options for the date function.
* </p>
* @param int $timestamp [optional]
* @param int|null $timestamp [optional]
* @return string|false a formatted date string. If a non-numeric value is used for
* timestamp, false is returned and an
* E_WARNING level error is emitted.
*/
#[Pure]
#[LanguageLevelTypeAware(["8.0" => "string"], default: "string|false")]
function gmdate (string $format, int $timestamp)
function gmdate (string $format, ?int $timestamp)
{}
/**
@ -764,7 +764,7 @@ function checkdate (int $month, int $day, int $year): bool
* As a result, %u may not function as described in this manual.
* @link https://php.net/manual/en/function.strftime.php
* @param string $format <p>
* @param int $timestamp [optional] defaults to the value of time()
* @param int|null $timestamp [optional] defaults to the value of time()
* Unix timestamp that defaults to the current local time if a timestamp is not given..
* @return string|false a string formatted according format
* using the given timestamp or the current
@ -772,7 +772,7 @@ function checkdate (int $month, int $day, int $year): bool
* other language-dependent strings respect the current locale set
* with setlocale.
*/
function strftime (string $format, int $timestamp): string|false
function strftime (string $format, ?int $timestamp): string|false
{}
/**
@ -781,14 +781,14 @@ function strftime (string $format, int $timestamp): string|false
* @param string $format <p>
* See description in strftime.
* </p>
* @param int $timestamp [optional]
* @param int|null $timestamp [optional]
* @return string|false a string formatted according to the given format string
* using the given timestamp or the current
* local time if no timestamp is given. Month and weekday names and
* other language dependent strings respect the current locale set
* with setlocale.
*/
function gmstrftime (string $format, int $timestamp): string|false
function gmstrftime (string $format, ?int $timestamp): string|false
{}
/**
@ -802,7 +802,7 @@ function time (): int
/**
* Get the local time
* @link https://php.net/manual/en/function.localtime.php
* @param int $timestamp [optional]
* @param int|null $timestamp [optional]
* @param bool $associative [optional] <p>
* If set to false or not supplied then the array is returned as a regular,
* numerically indexed array. If the argument is set to true then
@ -816,13 +816,13 @@ function time (): int
* @return array
*/
#[Pure]
function localtime (int $timestamp, bool $associative): array
function localtime (?int $timestamp, bool $associative): array
{}
/**
* Get date/time information
* @link https://php.net/manual/en/function.getdate.php
* @param int $timestamp [optional]
* @param int|null $timestamp [optional]
* @return array an associative array of information related to
* the timestamp. Elements from the returned
* associative array are as follows:
@ -899,7 +899,7 @@ function localtime (int $timestamp, bool $associative): array
* </table>
*/
#[Pure]
function getdate (int $timestamp): array
function getdate (?int $timestamp): array
{}
/**
@ -908,13 +908,13 @@ function getdate (int $timestamp): array
* @param string $datetime [optional] <p>
* String in a format accepted by strtotime.
* </p>
* @param DateTimeZone $timezone [optional] <p>
* @param DateTimeZone|null $timezone [optional] <p>
* Time zone of the time.
* </p>
* @return DateTime|false DateTime object on success or false on failure.
*/
#[Pure]
function date_create (string $datetime, DateTimeZone $timezone ): DateTime|false
function date_create (string $datetime, ?DateTimeZone $timezone ): DateTime|false
{}
/**
@ -926,13 +926,13 @@ function date_create (string $datetime, DateTimeZone $timezone ): DateTime|false
* @param string $datetime [optional] <p>
* String in a format accepted by strtotime.
* </p>
* @param DateTimeZone $timezone [optional] <p>
* @param DateTimeZone|null $timezone [optional] <p>
* Time zone of the time.
* </p>
* @return DateTimeImmutable|false DateTime object on success or false on failure.
*/
#[Pure]
function date_create_immutable (string $datetime, DateTimeZone $timezone): DateTimeImmutable|false
function date_create_immutable (string $datetime, ?DateTimeZone $timezone): DateTimeImmutable|false
{}
/**
@ -940,11 +940,11 @@ function date_create_immutable (string $datetime, DateTimeZone $timezone): DateT
* @link https://php.net/manual/en/function.date-create-immutable-from-format.php
* @param string $format
* @param string $datetime
* @param DateTimeZone $timezone [optional]
* @param DateTimeZone|null $timezone [optional]
* @return DateTimeImmutable|false
*/
#[Pure]
function date_create_immutable_from_format (string $format, string $datetime, DateTimeZone $timezone): DateTimeImmutable|false
function date_create_immutable_from_format (string $format, string $datetime, ?DateTimeZone $timezone): DateTimeImmutable|false
{}
/**
@ -956,12 +956,12 @@ function date_create_immutable_from_format (string $format, string $datetime, Da
* <p>If format contains the character !, then portions of the generated time not provided in format, as well as values to the left-hand side of the !, will be set to corresponding values from the Unix epoch.
* <p>The Unix epoch is 1970-01-01 00:00:00 UTC.
* @param string $datetime String representing the time.
* @param DateTimeZone $timezone [optional] A DateTimeZone object representing the desired time zone.
* @param DateTimeZone|null $timezone [optional] A DateTimeZone object representing the desired time zone.
* @return DateTime|false <p> Returns a new
* {@see DateTime} instance or <b>FALSE</b> on failure.</p>
*/
#[Pure]
function date_create_from_format (string $format, string $datetime, DateTimeZone $timezone): DateTime|false
function date_create_from_format (string $format, string $datetime, ?DateTimeZone $timezone): DateTime|false
{}
/**
@ -1302,13 +1302,13 @@ function timezone_location_get (DateTimeZone $object): array|false
* {@see DateTimeZone::listIdentifiers()}
* @link https://php.net/manual/en/function.timezone-identifiers-list.php
* @param int $timezoneGroup [optional] One of DateTimeZone class constants.
* @param string $countryCode [optional] A two-letter ISO 3166-1 compatible country code.
* @return array|false Returns array on success or FALSE on failure.
* @param string|null $countryCode [optional] A two-letter ISO 3166-1 compatible country code.
* @return void Returns array on success or FALSE on failure.
* Note: This option is only used when what is set to DateTimeZone::PER_COUNTRY.
*/
#[Pure]
#[LanguageLevelTypeAware(["8.0" => "array"], default: "array|false")]
function timezone_identifiers_list (int $timezoneGroup = DateTimeZone::ALL, string $countryCode)
function timezone_identifiers_list (int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode)
{}
/**
@ -1414,15 +1414,15 @@ function date_default_timezone_get (): string
* </tr>
* </table>
* </p>
* @param float $latitude [optional] <p>
* @param float|null $latitude [optional] <p>
* Defaults to North, pass in a negative value for South.
* See also: date.default_latitude
* </p>
* @param float $longitude [optional] <p>
* @param float|null $longitude [optional] <p>
* Defaults to East, pass in a negative value for West.
* See also: date.default_longitude
* </p>
* @param float $zenith [optional] <p>
* @param float|null $zenith [optional] <p>
* Default: date.sunrise_zenith
* </p>
* @param float $utcOffset [optional]
@ -1430,7 +1430,7 @@ function date_default_timezone_get (): string
* success or false on failure.
*/
#[Pure]
function date_sunrise (int $timestamp, int $returnFormat, float $latitude, float $longitude, float $zenith, float $utcOffset): string|int|float|false
function date_sunrise (int $timestamp, int $returnFormat, ?float $latitude, ?float $longitude, ?float $zenith, float $utcOffset): string|int|float|false
{}
/**
@ -1465,15 +1465,15 @@ function date_sunrise (int $timestamp, int $returnFormat, float $latitude, float
* </tr>
* </table>
* </p>
* @param float $latitude [optional] <p>
* @param float|null $latitude [optional] <p>
* Defaults to North, pass in a negative value for South.
* See also: date.default_latitude
* </p>
* @param float $longitude [optional] <p>
* @param float|null $longitude [optional] <p>
* Defaults to East, pass in a negative value for West.
* See also: date.default_longitude
* </p>
* @param float $zenith [optional] <p>
* @param float|null $zenith [optional] <p>
* Default: date.sunset_zenith
* </p>
* @param float $utcOffset [optional]
@ -1481,7 +1481,7 @@ function date_sunrise (int $timestamp, int $returnFormat, float $latitude, float
* success or false on failure.
*/
#[Pure]
function date_sunset (int $timestamp, int $returnFormat, float $latitude, float $longitude, float $zenith, float $utcOffset): string|int|float|false
function date_sunset (int $timestamp, int $returnFormat, ?float $latitude, ?float $longitude, ?float $zenith, float $utcOffset): string|int|float|false
{}
/**

View File

@ -9,9 +9,9 @@
* @param SimpleXMLElement $node <p>
* The <b>SimpleXMLElement</b> node.
* </p>
* @return DOMElement|false The <b>DOMElement</b> node added or <b>FALSE</b> if any errors occur.
* @return DOMElement|null|false The <b>DOMElement</b> node added or <b>FALSE</b> if any errors occur.
*/
function dom_import_simplexml (object $node): DOMElement {}
function dom_import_simplexml (object $node): ?DOMElement {}
/**

View File

@ -11,7 +11,7 @@ use JetBrains\PhpStorm\Deprecated;
* Since 7.2.0 this can either be a path to the file (stream wrappers are also supported as usual)
* or a stream resource.
* </p>
* @param string $required_sections [optional] <p>
* @param string|null $required_sections [optional] <p>
* Is a comma separated list of sections that need to be present in file
* to produce a result array. If none of the requested
* sections could be found the return value is <b>FALSE</b>.
@ -77,7 +77,7 @@ use JetBrains\PhpStorm\Deprecated;
* those headers. If no data can be returned,
* <b>exif_read_data</b> will return <b>FALSE</b>.
*/
function exif_read_data ($file, string $required_sections, bool $as_arrays = false, bool $read_thumbnail = false): array|false
function exif_read_data ($file, ?string $required_sections, bool $as_arrays = false, bool $read_thumbnail = false): array|false
{}
/**

View File

@ -6,14 +6,14 @@ use JetBrains\PhpStorm\Pure;
/**
* Sets the default domain
* @link https://php.net/manual/en/function.textdomain.php
* @param string $domain <p>
* @param string|null $domain <p>
* The new message domain, or <b>NULL</b> to get the current setting without
* changing it
* </p>
* @return string If successful, this function returns the current message
* domain, after possibly changing it.
*/
function textdomain (string $domain): string
function textdomain (?string $domain): string
{}
/**

View File

@ -370,7 +370,7 @@ function mhash_count (): int
* @param string $data <p>
* The user input, as a string.
* </p>
* @param string $key [optional] <p>
* @param string|null $key [optional] <p>
* If specified, the function will return the resulting HMAC instead.
* HMAC is keyed hashing for message authentication, or simply a message
* digest that depends on the specified key. Not all algorithms
@ -380,7 +380,7 @@ function mhash_count (): int
* <b>FALSE</b> on error.
*/
#[Pure]
function mhash (int $algo, string $data, string $key): string|false
function mhash (int $algo, string $data, ?string $key): string|false
{}

View File

@ -89,7 +89,7 @@ function iconv_set_encoding (string $type, string $encoding): bool
* @param string $string <p>
* The string.
* </p>
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* If <i>charset</i> parameter is omitted,
* <i>str</i> is assumed to be encoded in
* iconv.internal_encoding.
@ -97,7 +97,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 = 'ini_get("iconv.internal_encoding")'): int|false
{}
/**
@ -118,7 +118,7 @@ function iconv_strlen (string $string, string $encoding = 'ini_get("iconv.intern
* at the position, <i>offset</i> characters
* away from the end of <i>str</i>.
* </p>
* @param int $length [optional] <p>
* @param int|null $length [optional] <p>
* If <i>length</i> is given and is positive, the return
* value will contain at most <i>length</i> characters
* of the portion that begins at <i>offset</i>
@ -133,7 +133,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 $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* If <i>charset</i> parameter is omitted,
* <i>string</i> are assumed to be encoded in
* iconv.internal_encoding.
@ -154,7 +154,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 = 'ini_get("iconv.internal_encoding")'): string|false
{}
/**
@ -170,7 +170,7 @@ function iconv_substr (string $string, int $offset, int $length, string $encodin
* The optional <i>offset</i> parameter specifies
* the position from which the search should be performed.
* </p>
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* If <i>charset</i> parameter is omitted,
* <i>string</i> are assumed to be encoded in
* iconv.internal_encoding.
@ -184,7 +184,7 @@ function iconv_substr (string $string, int $offset, int $length, string $encodin
* </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 = 'ini_get("iconv.internal_encoding")'): int|false
{}
/**
@ -196,7 +196,7 @@ function iconv_strpos (string $haystack, string $needle, int $offset = 0, string
* @param string $needle <p>
* The searched substring.
* </p>
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* If <i>charset</i> parameter is omitted,
* <i>string</i> are assumed to be encoded in
* iconv.internal_encoding.
@ -210,7 +210,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 = 'ini_get("iconv.internal_encoding")'): int|false
{}
/**
@ -355,7 +355,7 @@ function iconv_mime_encode (string $field_name, string $field_value, array $opti
* </tr>
* </table>
* </p>
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* The optional <i>charset</i> parameter specifies the
* character set to represent the result by. If omitted,
* iconv.internal_encoding
@ -365,7 +365,7 @@ function iconv_mime_encode (string $field_name, string $field_value, array $opti
* 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 = 'ini_get("iconv.internal_encoding")'): string|false
{}
/**
@ -408,7 +408,7 @@ function iconv_mime_decode (string $string, int $mode = 0, string $encoding = 'i
* </tr>
* </table>
* </p>
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* The optional <i>charset</i> parameter specifies the
* character set to represent the result by. If omitted,
* iconv.internal_encoding
@ -428,7 +428,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 = 'ini_get("iconv.internal_encoding")'): array|false
{}

View File

@ -108,7 +108,7 @@ function json_encode (mixed $value, int $flags = 0, int $depth = 512): string|fa
* 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 $associative [optional] <p>
* @param bool|null $associative [optional] <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|fa
* <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 = false, int $depth = 512, int $flags = 0): mixed {}
/**
* Returns the last error occurred

View File

@ -45,14 +45,14 @@ function ldap_exop_whoami ($ldap): string|bool
* @link https://www.php.net/manual/en/function.ldap-exop.php
* @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 $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 $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 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 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
*/
function ldap_exop ($ldap , string $request_oid , string $request_data , array $controls = [], &$response_data, &$response_oid)
function ldap_exop ($ldap , string $request_oid , ?string $request_data , ?array $controls = [], &$response_data, &$response_oid)
{}
/**
@ -89,7 +89,7 @@ function ldap_t61_to_8859(string $value): string
/**
* Connect to an LDAP server
* @link https://php.net/manual/en/function.ldap-connect.php
* @param string $uri [optional] <p>
* @param string|null $uri [optional] <p>
* If you are using OpenLDAP 2.x.x you can specify a URL instead of the
* hostname. To use LDAP with SSL, compile OpenLDAP 2.x.x with SSL
* support, configure PHP with SSL, and set this parameter as
@ -109,7 +109,7 @@ function ldap_t61_to_8859(string $value): string
* If no arguments are specified then the link identifier of the already
* opened link will be returned.
*/
function ldap_connect (string $uri, int $port = 389)
function ldap_connect (?string $uri, int $port = 389)
{}
/**
@ -125,11 +125,11 @@ function ldap_close ($ldap): bool {}
* @param resource $ldap <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param string $dn [optional]
* @param string $password [optional]
* @param string|null $dn [optional]
* @param string|null $password [optional]
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_bind ($ldap, string $dn, string $password): bool
function ldap_bind ($ldap, ?string $dn, ?string $password): bool
{}
/**
@ -139,13 +139,13 @@ function ldap_bind ($ldap, string $dn, string $password): bool
* @param resource $ldap <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param string $dn [optional]
* @param string $password [optional]
* @param array $controls [optional] Array of LDAP Controls to send with the request.
* @param string|null $dn [optional]
* @param string|null $password [optional]
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @return resource|false
* @since 7.3
*/
function ldap_bind_ext ($ldap, string $dn, string $password, array $controls = [])
function ldap_bind_ext ($ldap, ?string $dn, ?string $password, ?array $controls = [])
{}
@ -235,10 +235,10 @@ function ldap_unbind ($ldap): bool
* one of the following:
* <b>LDAP_DEREF_NEVER</b> - (default) aliases are never
* dereferenced.
* @param array $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @return resource|false a search result identifier or <b>FALSE</b> on error.
*/
function ldap_read ($ldap, array|string $base, array|string $filter, array $attributes, int $attributes_only, int $sizelimit, int $timelimit, int $deref, array $controls = [])
function ldap_read ($ldap, array|string $base, array|string $filter, array $attributes, int $attributes_only, int $sizelimit, int $timelimit, int $deref, ?array $controls = [])
{}
/**
@ -294,10 +294,10 @@ function ldap_read ($ldap, array|string $base, array|string $filter, array $attr
* one of the following:
* <b>LDAP_DEREF_NEVER</b> - (default) aliases are never
* dereferenced.
* @param array $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @return resource|false a search result identifier or <b>FALSE</b> on error.
*/
function ldap_list ($ldap, array|string $base, array|string $filter, array $attributes, int $attributes_only, int $sizelimit, int $timelimit, int $deref, array $controls = [])
function ldap_list ($ldap, array|string $base, array|string $filter, array $attributes, int $attributes_only, int $sizelimit, int $timelimit, int $deref, ?array $controls = [])
{}
/**
@ -357,10 +357,10 @@ function ldap_list ($ldap, array|string $base, array|string $filter, array $attr
* one of the following:
* <b>LDAP_DEREF_NEVER</b> - (default) aliases are never
* dereferenced.
* @param array $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @return resource|false a search result identifier or <b>FALSE</b> on error.
*/
function ldap_search ($ldap, array|string $base, array|string $filter, array $attributes, int $attributes_only, int $sizelimit, int $timelimit, int $deref, array $controls = [])
function ldap_search ($ldap, array|string $base, array|string $filter, array $attributes, int $attributes_only, int $sizelimit, int $timelimit, int $deref, ?array $controls = [])
{}
/**
@ -585,10 +585,10 @@ function ldap_dn2ufn (string $dn): string|false
* $entree["attribut2"][1] = "value2";
* </code>
* </p>
* @param array $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls [optional] 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 ($ldap, string $dn, array $entry, array $controls = []): bool
function ldap_add ($ldap, string $dn, array $entry, ?array $controls = []): bool
{}
/**
@ -612,11 +612,11 @@ function ldap_add ($ldap, string $dn, array $entry, array $controls = []): bool
* $entree["attribut2"][1] = "value2";
* </code>
* </p>
* @param array $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @return resource|false
* @since 7.4
*/
function ldap_add_ext ($ldap, string $dn, array $entry, array $controls = [])
function ldap_add_ext ($ldap, string $dn, array $entry, ?array $controls = [])
{}
/**
@ -628,10 +628,10 @@ function ldap_add_ext ($ldap, string $dn, array $entry, array $controls = [])
* @param string $dn <p>
* The distinguished name of an LDAP entity.
* </p>
* @param array $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls [optional] 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 ($ldap, string $dn, array $controls = []): bool
function ldap_delete ($ldap, string $dn, ?array $controls = []): bool
{}
/**
@ -644,11 +644,11 @@ function ldap_delete ($ldap, string $dn, array $controls = []): bool
* @param string $dn <p>
* The distinguished name of an LDAP entity.
* </p>
* @param array $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @return resource|false
* @since 7.3
*/
function ldap_delete_ext ($ldap, string $dn, array $controls = [])
function ldap_delete_ext ($ldap, string $dn, ?array $controls = [])
{}
/**
@ -662,11 +662,11 @@ function ldap_delete_ext ($ldap, string $dn, array $controls = [])
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry
* @param array $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls [optional] 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
*/
function ldap_modify ($ldap, string $dn, array $entry, array $controls = []): bool
function ldap_modify ($ldap, string $dn, array $entry, ?array $controls = []): bool
{}
/**
@ -679,10 +679,10 @@ function ldap_modify ($ldap, string $dn, array $entry, array $controls = []): bo
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry
* @param array $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls [optional] 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 ($ldap, string $dn, array $entry, array $controls = []): bool
function ldap_mod_add ($ldap, string $dn, array $entry, ?array $controls = []): bool
{}
/**
@ -696,10 +696,10 @@ function ldap_mod_add ($ldap, string $dn, array $entry, array $controls = []): b
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry
* @param array $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @return resource|false
*/
function ldap_mod_add_ext ($ldap, string $dn, array $entry, array $controls = [])
function ldap_mod_add_ext ($ldap, string $dn, array $entry, ?array $controls = [])
{}
/**
@ -712,10 +712,10 @@ function ldap_mod_add_ext ($ldap, string $dn, array $entry, array $controls = []
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry
* @param array $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls [optional] 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 ($ldap, string $dn, array $entry, array $controls = []): bool
function ldap_mod_replace ($ldap, string $dn, array $entry, ?array $controls = []): bool
{}
/**
@ -729,11 +729,11 @@ function ldap_mod_replace ($ldap, string $dn, array $entry, array $controls = []
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry
* @param array $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @return resource|false
* @since 7.3
*/
function ldap_mod_replace_ext ($ldap, string $dn, array $entry, array $controls = [])
function ldap_mod_replace_ext ($ldap, string $dn, array $entry, ?array $controls = [])
{}
/**
@ -746,10 +746,10 @@ function ldap_mod_replace_ext ($ldap, string $dn, array $entry, array $controls
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry
* @param array $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls [optional] 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 ($ldap, string $dn, array $entry, array $controls = []): bool
function ldap_mod_del ($ldap, string $dn, array $entry, ?array $controls = []): bool
{}
/**
@ -763,11 +763,11 @@ function ldap_mod_del ($ldap, string $dn, array $entry, array $controls = []): b
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry
* @param array $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @return resource|false
* @since 7.3
*/
function ldap_mod_del_ext ($ldap, string $dn, array $entry, array $controls = [])
function ldap_mod_del_ext ($ldap, string $dn, array $entry, ?array $controls = [])
{}
/**
@ -819,11 +819,11 @@ function ldap_error ($ldap): string
* @param string $value <p>
* The compared value.
* </p>
* @param array $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls [optional] 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.
*/
function ldap_compare ($ldap, string $dn, string $attribute, string $value, array $controls = []): int|bool
function ldap_compare ($ldap, string $dn, string $attribute, string $value, ?array $controls = []): int|bool
{}
/**
@ -865,10 +865,10 @@ function ldap_sort ($ldap, $result, string $sortfilter): bool
* 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 $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls [optional] 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 ($ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, array $controls = []): bool
function ldap_rename ($ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, ?array $controls = []): bool
{}
/**
@ -891,11 +891,11 @@ function ldap_rename ($ldap, string $dn, string $new_rdn, string $new_parent, bo
* 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 $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls [optional] Array of LDAP Controls to send with the request.
* @return resource|false
* @since 7.3
*/
function ldap_rename_ext ($ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, array $controls = [])
function ldap_rename_ext ($ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, ?array $controls = [])
{}
/**
@ -1130,10 +1130,10 @@ function ldap_start_tls ($ldap): bool
* Set a callback function to do re-binds on referral chasing
* @link https://php.net/manual/en/function.ldap-set-rebind-proc.php
* @param resource $ldap
* @param callable $callback
* @param callable|null $callback
* @return bool
*/
function ldap_set_rebind_proc ($ldap, callable $callback): bool
function ldap_set_rebind_proc ($ldap, ?callable $callback): bool
{}
/**
@ -1270,11 +1270,11 @@ function ldap_escape (string $value, string $ignore = "", int $flags = 0): strin
* any value for <em>modtype</em> must be one of the
* <b>LDAP_MODIFY_BATCH_*</b> constants listed above.
* </p></p>
* @param array $controls [optional] Array of LDAP Controls to send with the request.
* @param array|null $controls [optional] 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
*/
function ldap_modify_batch ($ldap , string $dn , array $modifications_info, array $controls = []): bool
function ldap_modify_batch ($ldap , string $dn , array $modifications_info, ?array $controls = []): bool
{}
/**

View File

@ -76,13 +76,13 @@ 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 $use_errors [optional] <p>
* @param bool|null $use_errors [optional] <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
* <i>use_errors</i>.
*/
function libxml_use_internal_errors (bool $use_errors = false): bool {}
function libxml_use_internal_errors (?bool $use_errors = false): bool {}
/**
* Retrieve last error from libxml
@ -129,7 +129,7 @@ function libxml_disable_entity_loader (bool $disable = true): bool
/**
* Changes the default external entity loader
* @link https://php.net/manual/en/function.libxml-set-external-entity-loader.php
* @param callable $resolver_function <p>
* @param callable|null $resolver_function <p>
* A callable that takes three arguments. Two strings, a public id
* and system id, and a context (an array with four keys) as the third argument.
* This callback should return a resource, a string from which a resource can be
@ -138,7 +138,7 @@ function libxml_disable_entity_loader (bool $disable = true): bool
* @return bool
* @since 5.4
*/
function libxml_set_external_entity_loader (callable $resolver_function): bool {}
function libxml_set_external_entity_loader (?callable $resolver_function): bool {}
/**

View File

@ -20,12 +20,12 @@ use JetBrains\PhpStorm\Pure;
* MB_CASE_LOWER, or
* MB_CASE_TITLE.
* </p>
* @param string $encoding [optional] &mbstring.encoding.parameter;
* @param string|null $encoding [optional] &mbstring.encoding.parameter;
* @return string A case folded version of string converted in the
* way specified by mode.
*/
#[Pure]
function mb_convert_case (string $string, int $mode, string $encoding): string
function mb_convert_case (string $string, int $mode, ?string $encoding): string
{}
/**
@ -34,11 +34,11 @@ function mb_convert_case (string $string, int $mode, string $encoding): string
* @param string $string <p>
* The string being uppercased.
* </p>
* @param string $encoding [optional] &mbstring.encoding.parameter;
* @param string|null $encoding [optional] &mbstring.encoding.parameter;
* @return string str with all alphabetic characters converted to uppercase.
*/
#[Pure]
function mb_strtoupper (string $string, string $encoding): string
function mb_strtoupper (string $string, ?string $encoding): string
{}
/**
@ -47,17 +47,17 @@ function mb_strtoupper (string $string, string $encoding): string
* @param string $string <p>
* The string being lowercased.
* </p>
* @param string $encoding [optional] &mbstring.encoding.parameter;
* @param string|null $encoding [optional] &mbstring.encoding.parameter;
* @return string str with all alphabetic characters converted to lowercase.
*/
#[Pure]
function mb_strtolower (string $string, string $encoding): string
function mb_strtolower (string $string, ?string $encoding): string
{}
/**
* Set/Get current language
* @link https://php.net/manual/en/function.mb-language.php
* @param string $language [optional] <p>
* @param string|null $language [optional] <p>
* Used for encoding
* e-mail messages. Valid languages are "Japanese",
* "ja","English","en" and "uni"
@ -76,13 +76,13 @@ function mb_strtolower (string $string, string $encoding): string
* name as a string. If no language is set previously, it then returns
* false.
*/
function mb_language (string $language): string|bool
function mb_language (?string $language): string|bool
{}
/**
* Set/Get internal character encoding
* @link https://php.net/manual/en/function.mb-internal-encoding.php
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* encoding is the character encoding name
* used for the HTTP input character encoding conversion, HTTP output
* character encoding conversion, and the default character encoding
@ -93,13 +93,13 @@ function mb_language (string $language): string|bool
* If encoding is omitted, then
* the current character encoding name is returned.
*/
function mb_internal_encoding (string $encoding): string|bool
function mb_internal_encoding (?string $encoding): string|bool
{}
/**
* Detect HTTP input character encoding
* @link https://php.net/manual/en/function.mb-http-input.php
* @param string $type [optional] <p>
* @param string|null $type [optional] <p>
* Input string specifies the input type.
* "G" for GET, "P" for POST, "C" for COOKIE, "S" for string, "L" for list, and
* "I" for the whole list (will return array).
@ -110,13 +110,13 @@ function mb_internal_encoding (string $encoding): string|bool
* HTTP input, it returns false.
*/
#[Pure]
function mb_http_input (string $type): array|string|false
function mb_http_input (?string $type): array|string|false
{}
/**
* Set/Get HTTP output character encoding
* @link https://php.net/manual/en/function.mb-http-output.php
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* If encoding is set,
* mb_http_output sets the HTTP output character
* encoding to encoding.
@ -131,7 +131,7 @@ function mb_http_input (string $type): array|string|false
* character encoding. Otherwise,
* true on success or false on failure.
*/
function mb_http_output (string $encoding): string|bool
function mb_http_output (?string $encoding): string|bool
{}
/**
@ -261,14 +261,14 @@ function mb_preferred_mime_name (string $encoding): string|false
* @param string $string <p>
* The string being checked for length.
* </p>
* @param string $encoding [optional] &mbstring.encoding.parameter;
* @param string|null $encoding [optional] &mbstring.encoding.parameter;
* @return int the number of characters in
* string str having character encoding
* encoding. A multi-byte character is
* counted as 1.
*/
#[Pure]
function mb_strlen (string $string, string $encoding): int
function mb_strlen (string $string, ?string $encoding): int
{}
/**
@ -283,14 +283,14 @@ function mb_strlen (string $string, string $encoding): int
* @param int $offset [optional] <p>
* The search offset. If it is not specified, 0 is used.
* </p>
* @param string $encoding [optional] &mbstring.encoding.parameter;
* @param string|null $encoding [optional] &mbstring.encoding.parameter;
* @return int|false the numeric position of
* the first occurrence of needle in the
* haystack string. If
* needle is not found, it returns false.
*/
#[Pure]
function mb_strpos (string $haystack, string $needle, int $offset = 0, string $encoding): int|false
function mb_strpos (string $haystack, string $needle, int $offset = 0, ?string $encoding): int|false
{}
/**
@ -306,14 +306,14 @@ function mb_strpos (string $haystack, string $needle, int $offset = 0, string $e
* @param int $offset [optional] May be specified to begin searching an arbitrary number of characters into
* the string. Negative values will stop searching at an arbitrary point
* prior to the end of the string.
* @param string $encoding [optional] &mbstring.encoding.parameter;
* @param string|null $encoding [optional] &mbstring.encoding.parameter;
* @return int|false the numeric position of
* the last occurrence of needle in the
* haystack string. If
* needle is not found, it returns false.
*/
#[Pure]
function mb_strrpos (string $haystack, string $needle, int $offset = 0, string $encoding): int|false
function mb_strrpos (string $haystack, string $needle, int $offset = 0, ?string $encoding): int|false
{}
/**
@ -330,7 +330,7 @@ function mb_strrpos (string $haystack, string $needle, int $offset = 0, string $
* The position in haystack
* to start searching
* </p>
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* Character encoding name to use.
* If it is omitted, internal character encoding is used.
* </p>
@ -339,7 +339,7 @@ function mb_strrpos (string $haystack, string $needle, int $offset = 0, string $
* string, or false if needle is not found.
*/
#[Pure]
function mb_stripos (string $haystack, string $needle, int $offset = 0, string $encoding): int|false
function mb_stripos (string $haystack, string $needle, int $offset = 0, ?string $encoding): int|false
{}
/**
@ -356,7 +356,7 @@ function mb_stripos (string $haystack, string $needle, int $offset = 0, string $
* The position in haystack
* to start searching
* </p>
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* Character encoding name to use.
* If it is omitted, internal character encoding is used.
* </p>
@ -366,7 +366,7 @@ function mb_stripos (string $haystack, string $needle, int $offset = 0, string $
* if needle is not found.
*/
#[Pure]
function mb_strripos (string $haystack, string $needle, int $offset = 0, string $encoding): int|false
function mb_strripos (string $haystack, string $needle, int $offset = 0, ?string $encoding): int|false
{}
/**
@ -387,7 +387,7 @@ function mb_strripos (string $haystack, string $needle, int $offset = 0, string
* If set to false, it returns all of haystack
* from the first occurrence of needle to the end,
* </p>
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* Character encoding name to use.
* If it is omitted, internal character encoding is used.
* </p>
@ -395,7 +395,7 @@ function mb_strripos (string $haystack, string $needle, int $offset = 0, string
* or false if needle is not found.
*/
#[Pure]
function mb_strstr (string $haystack, string $needle, bool $before_needle = false, string $encoding): string|false
function mb_strstr (string $haystack, string $needle, bool $before_needle = false, ?string $encoding): string|false
{}
/**
@ -416,7 +416,7 @@ function mb_strstr (string $haystack, string $needle, bool $before_needle = fals
* If set to false, it returns all of haystack
* from the last occurrence of needle to the end,
* </p>
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* Character encoding name to use.
* If it is omitted, internal character encoding is used.
* </p>
@ -424,7 +424,7 @@ function mb_strstr (string $haystack, string $needle, bool $before_needle = fals
* or false if needle is not found.
*/
#[Pure]
function mb_strrchr (string $haystack, string $needle, bool $before_needle = false, string $encoding): string|false
function mb_strrchr (string $haystack, string $needle, bool $before_needle = false, ?string $encoding): string|false
{}
/**
@ -445,7 +445,7 @@ function mb_strrchr (string $haystack, string $needle, bool $before_needle = fal
* If set to false, it returns all of haystack
* from the first occurrence of needle to the end,
* </p>
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* Character encoding name to use.
* If it is omitted, internal character encoding is used.
* </p>
@ -453,7 +453,7 @@ function mb_strrchr (string $haystack, string $needle, bool $before_needle = fal
* or false if needle is not found.
*/
#[Pure]
function mb_stristr (string $haystack, string $needle, bool $before_needle = false, string $encoding): string|false
function mb_stristr (string $haystack, string $needle, bool $before_needle = false, ?string $encoding): string|false
{}
/**
@ -474,7 +474,7 @@ function mb_stristr (string $haystack, string $needle, bool $before_needle = fal
* If set to false, it returns all of haystack
* from the last occurrence of needle to the end,
* </p>
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* Character encoding name to use.
* If it is omitted, internal character encoding is used.
* </p>
@ -482,7 +482,7 @@ function mb_stristr (string $haystack, string $needle, bool $before_needle = fal
* or false if needle is not found.
*/
#[Pure]
function mb_strrichr (string $haystack, string $needle, bool $before_needle = false, string $encoding): string|false
function mb_strrichr (string $haystack, string $needle, bool $before_needle = false, ?string $encoding): string|false
{}
/**
@ -494,13 +494,13 @@ function mb_strrichr (string $haystack, string $needle, bool $before_needle = fa
* @param string $needle <p>
* The string being found.
* </p>
* @param string $encoding [optional] &mbstring.encoding.parameter;
* @param string|null $encoding [optional] &mbstring.encoding.parameter;
* @return int The number of times the
* needle substring occurs in the
* haystack string.
*/
#[Pure]
function mb_substr_count (string $haystack, string $needle, string $encoding): int
function mb_substr_count (string $haystack, string $needle, ?string $encoding): int
{}
/**
@ -512,17 +512,17 @@ function mb_substr_count (string $haystack, string $needle, string $encoding): i
* @param int $start <p>
* The first position used in str.
* </p>
* @param int $length [optional] <p>
* @param int|null $length [optional] <p>
* The maximum length of the returned string.
* </p>
* @param string $encoding [optional] &mbstring.encoding.parameter;
* @param string|null $encoding [optional] &mbstring.encoding.parameter;
* @return string mb_substr returns the portion of
* str specified by the
* start and
* length parameters.
*/
#[Pure]
function mb_substr (string $string, int $start, int $length, string $encoding): string
function mb_substr (string $string, int $start, ?int $length, ?string $encoding): string
{}
/**
@ -534,17 +534,17 @@ function mb_substr (string $string, int $start, int $length, string $encoding):
* @param int $start <p>
* The position that begins the cut.
* </p>
* @param int $length [optional] <p>
* @param int|null $length [optional] <p>
* The string being decoded.
* </p>
* @param string $encoding [optional] &mbstring.encoding.parameter;
* @param string|null $encoding [optional] &mbstring.encoding.parameter;
* @return string mb_strcut returns the portion of
* str specified by the
* start and
* length parameters.
*/
#[Pure]
function mb_strcut (string $string, int $start, int $length, string $encoding): string
function mb_strcut (string $string, int $start, ?int $length, ?string $encoding): string
{}
/**
@ -553,11 +553,11 @@ function mb_strcut (string $string, int $start, int $length, string $encoding):
* @param string $string <p>
* The string being decoded.
* </p>
* @param string $encoding [optional] &mbstring.encoding.parameter;
* @param string|null $encoding [optional] &mbstring.encoding.parameter;
* @return int The width of string str.
*/
#[Pure]
function mb_strwidth (string $string, string $encoding): int
function mb_strwidth (string $string, ?string $encoding): int
{}
/**
@ -577,12 +577,12 @@ function mb_strwidth (string $string, string $encoding): int
* A string that is added to the end of string
* when string is truncated.
* </p>
* @param string $encoding [optional] &mbstring.encoding.parameter;
* @param string|null $encoding [optional] &mbstring.encoding.parameter;
* @return string The truncated string. If trimmarker is set,
* 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
{}
/**
@ -768,11 +768,11 @@ function mb_encoding_aliases (string $encoding)
* </tr>
* </table>
* </p>
* @param string $encoding [optional] &mbstring.encoding.parameter;
* @param string|null $encoding [optional] &mbstring.encoding.parameter;
* @return string The converted string.
*/
#[Pure]
function mb_convert_kana (string $string, string $mode, string $encoding): string
function mb_convert_kana (string $string, string $mode, ?string $encoding): string
{}
/**
@ -781,13 +781,13 @@ function mb_convert_kana (string $string, string $mode, string $encoding): strin
* @param string $string <p>
* The string being encoded.
* </p>
* @param string $charset [optional] <p>
* @param string|null $charset [optional] <p>
* charset specifies the name of the character set
* in which str is represented in. The default value
* is determined by the current NLS setting (mbstring.language).
* mb_internal_encoding should be set to same encoding.
* </p>
* @param string $transfer_encoding [optional] <p>
* @param string|null $transfer_encoding [optional] <p>
* transfer_encoding specifies the scheme of MIME
* encoding. It should be either "B" (Base64) or
* "Q" (Quoted-Printable). Falls back to
@ -808,7 +808,7 @@ function mb_convert_kana (string $string, string $mode, string $encoding): strin
* @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, int $indent): string
function mb_encode_mimeheader (string $string, ?string $charset, ?string $transfer_encoding, string $newline, int $indent): string
{}
/**
@ -863,7 +863,7 @@ function mb_convert_variables (string $to_encoding, array|string $from_encoding,
* @return string The converted string.
*/
#[Pure]
function mb_encode_numericentity (string $string, array $map, string $encoding, bool $hex = false): string
function mb_encode_numericentity (string $string, array $map, ?string $encoding, bool $hex = false): string
{}
#[PhpStormStubsElementAvailable(to: '7.4')]
@ -884,7 +884,7 @@ function mb_encode_numericentity (string $string, array $map, string $encoding,
* @return string|false|null The converted string.
*/
#[Pure]
function mb_decode_numericentity ($string, array $map, string $encoding, $is_hex = false): string|false|null
function mb_decode_numericentity ($string, array $map, ?string $encoding, $is_hex = false): string|false|null
{}
#[PhpStormStubsElementAvailable('8.0')]
@ -902,7 +902,7 @@ function mb_decode_numericentity ($string, array $map, string $encoding, $is_hex
* @return string The converted string.
*/
#[Pure]
function mb_decode_numericentity ($string, array $map, string $encoding): string
function mb_decode_numericentity ($string, array $map, ?string $encoding): string
{}
/**
@ -927,14 +927,14 @@ function mb_decode_numericentity ($string, array $map, string $encoding): string
* headers. Multiple extra headers are separated with a
* newline ("\n").
* </p>
* @param string $additional_params [optional] <p>
* @param string|null $additional_params [optional] <p>
* additional_parameter is a MTA command line
* parameter. It is useful when setting the correct Return-Path
* header when using sendmail.
* </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
{}
/**
@ -965,38 +965,38 @@ function mb_get_info (string $type): array|string|int|false
* The byte stream to check. If it is omitted, this function checks
* all the input from the beginning of the request.
* </p>
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* The expected encoding.
* </p>
* @return bool true on success or false on failure.
* @since 5.1.3
*/
#[Pure]
function mb_check_encoding (array|string $value = null, string $encoding): bool
function mb_check_encoding (array|string $value = null, ?string $encoding): bool
{}
/**
* Returns current encoding for multibyte regex as string
* @link https://php.net/manual/en/function.mb-regex-encoding.php
* @param string $encoding [optional] &mbstring.encoding.parameter;
* @param string|null $encoding [optional] &mbstring.encoding.parameter;
* @return bool|string If encoding is set, then Returns TRUE on success
* or FALSE on failure. In this case, the internal character encoding
* is NOT changed. If encoding is omitted, then the current character
* encoding name for a multibyte regex is returned.
*/
function mb_regex_encoding (string $encoding): string|bool
function mb_regex_encoding (?string $encoding): string|bool
{}
/**
* Set/Get the default options for mbregex functions
* @link https://php.net/manual/en/function.mb-regex-set-options.php
* @param string $options [optional] <p>
* @param string|null $options [optional] <p>
* The options to set.
* </p>
* @return string The previous options. If options is omitted,
* it returns the string that describes the current options.
*/
function mb_regex_set_options (string $options): string
function mb_regex_set_options (?string $options): string
{}
/**
@ -1048,7 +1048,7 @@ function mb_eregi (string $pattern, string $string, &$matches): bool
* @param string $string <p>
* The string being checked.
* </p>
* @param string $options [optional] Matching condition can be set by option
* @param string|null $options [optional] 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
@ -1062,7 +1062,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 = "msr"): string|false|null
{}
/**
@ -1108,7 +1108,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 = "msr"): string|false|null
{}
/**
@ -1123,13 +1123,13 @@ function mb_ereg_replace_callback (string $pattern, callable $callback, string $
* @param string $string <p>
* The searched string.
* </p>
* @param string $options [optional] option has the same meaning as in
* @param string|null $options [optional] 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 = "msr"): string|false|null
{}
/**
@ -1159,36 +1159,36 @@ function mb_split (string $pattern, string $string, int $limit): array|false
* @param string $string <p>
* The string being evaluated.
* </p>
* @param string $options [optional] <p>
* @param string|null $options [optional] <p>
* </p>
* @return bool
*/
#[Pure]
function mb_ereg_match (string $pattern, string $string, string $options): bool
function mb_ereg_match (string $pattern, string $string, ?string $options): bool
{}
/**
* Multibyte regular expression match for predefined multibyte string
* @link https://php.net/manual/en/function.mb-ereg-search.php
* @param string $pattern [optional] <p>
* @param string|null $pattern [optional] <p>
* The search pattern.
* </p>
* @param string $options [optional] <p>
* @param string|null $options [optional] <p>
* The search option.
* </p>
* @return bool
*/
#[Pure]
function mb_ereg_search (string $pattern, string $options): bool
function mb_ereg_search (?string $pattern, ?string $options): bool
{}
/**
* Returns position and length of a matched part of the multibyte regular expression for a predefined multibyte string
* @link https://php.net/manual/en/function.mb-ereg-search-pos.php
* @param string $pattern [optional] <p>
* @param string|null $pattern [optional] <p>
* The search pattern.
* </p>
* @param string $options [optional] <p>
* @param string|null $options [optional] <p>
* The search option.
* </p>
* @return int[]|false An array containing two elements. The first
@ -1197,16 +1197,16 @@ function mb_ereg_search (string $pattern, string $options): bool
* length in bytes of the match. If an error occurs, FALSE is returned.
*/
#[Pure]
function mb_ereg_search_pos (string $pattern, string $options): array|false
function mb_ereg_search_pos (?string $pattern, ?string $options): array|false
{}
/**
* Returns the matched part of a multibyte regular expression
* @link https://php.net/manual/en/function.mb-ereg-search-regs.php
* @param string $pattern [optional] <p>
* @param string|null $pattern [optional] <p>
* The search pattern.
* </p>
* @param string $options [optional] <p>
* @param string|null $options [optional] <p>
* The search option.
* </p>
* @return string[]|false mb_ereg_search_regs() executes the multibyte
@ -1216,7 +1216,7 @@ function mb_ereg_search_pos (string $pattern, string $options): array|false
* part as third element, and so on. It returns FALSE on error.
*/
#[Pure]
function mb_ereg_search_regs (string $pattern, string $options): array|false
function mb_ereg_search_regs (?string $pattern, ?string $options): array|false
{}
/**
@ -1225,15 +1225,15 @@ function mb_ereg_search_regs (string $pattern, string $options): array|false
* @param string $string <p>
* The search string.
* </p>
* @param string $pattern [optional] <p>
* @param string|null $pattern [optional] <p>
* The search pattern.
* </p>
* @param string $options [optional] <p>
* @param string|null $options [optional] <p>
* The search option.
* </p>
* @return bool
*/
function mb_ereg_search_init (string $string, string $pattern, string $options): bool
function mb_ereg_search_init (string $string, ?string $pattern, ?string $options): bool
{}
/**
@ -1399,37 +1399,37 @@ function mbereg_search_getpos () {}
* Get a specific character.
* @link https://www.php.net/manual/en/function.mb-chr.php
* @param int $codepoint
* @param string $encoding [optional]
* @param string|null $encoding [optional]
* @return string|false specific character or FALSE on failure.
* @since 7.2
*/
#[Pure]
function mb_chr (int $codepoint, string $encoding): string|false
function mb_chr (int $codepoint, ?string $encoding): string|false
{}
/**
* Get code point of character
* @link https://www.php.net/manual/en/function.mb-ord.php
* @param string $string
* @param string $encoding [optional]
* @param string|null $encoding [optional]
* @return int|false code point of character or FALSE on failure.
* @since 7.2
*/
#[Pure]
function mb_ord (string $string, string $encoding): int|false
function mb_ord (string $string, ?string $encoding): int|false
{}
/**
* Scrub broken multibyte strings.
* @link https://www.php.net/manual/en/function.mb-scrub.php
* @param string $string
* @param string $encoding [optional]
* @param string|null $encoding [optional]
* @return string|false
* @since 7.2
*/
#[Pure]
#[LanguageLevelTypeAware(["8.0" => "string"], default: "string|false")]
function mb_scrub (string $string, string $encoding): bool|string
function mb_scrub (string $string, ?string $encoding): bool|string
{}
/**
@ -1449,7 +1449,7 @@ function mbereg_search_setpos ($position) {}
* @param int $length [optional] <p>
* If specified, each element of the returned array will be composed of multiple characters instead of a single character.
* </p>
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* Character encoding name to use.
* If it is omitted, internal character encoding is used.
* </p>
@ -1458,7 +1458,7 @@ function mbereg_search_setpos ($position) {}
*/
#[Pure]
#[LanguageLevelTypeAware(["8.0" => "array"], default: "array|false")]
function mb_str_split (string $string, int $length = 1, string $encoding)
function mb_str_split (string $string, int $length = 1, ?string $encoding)
{}
/**

View File

@ -1494,11 +1494,11 @@ function mysqli_autocommit (mysqli $mysql, bool $enable): bool
* @link https://secure.php.net/manual/en/mysqli.begin-transaction.php
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @param int $flags [optional]
* @param string $name [optional]
* @param string|null $name [optional]
* @return bool true on success or false on failure.
* @since 5.5
*/
function mysqli_begin_transaction (mysqli $mysql, int $flags = 0, string $name): bool
function mysqli_begin_transaction (mysqli $mysql, int $flags = 0, ?string $name): bool
{}
/**
@ -1507,19 +1507,19 @@ function mysqli_begin_transaction (mysqli $mysql, int $flags = 0, string $name):
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @param string $username The MySQL user name.
* @param string $password The MySQL password.
* @param string $database The database to change to. If desired, the NULL value may be passed resulting in only changing the user and not selecting a database.
* @param string|null $database The database to change to. If desired, the NULL value may be passed resulting in only changing the user and not selecting a database.
* @return bool
*/
function mysqli_change_user (mysqli $mysql, string $username, string $password, string $database): bool
function mysqli_change_user (mysqli $mysql, string $username, string $password, ?string $database): bool
{}
/**
* Returns the default character set for the database connection
* @link https://php.net/manual/en/mysqli.character-set-name.php
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return string The default character set for the current connection
* @return string|null The default character set for the current connection
*/
function mysqli_character_set_name (mysqli $mysql): string
function mysqli_character_set_name (mysqli $mysql): ?string
{}
/**
@ -1536,25 +1536,25 @@ function mysqli_close (mysqli $mysql): bool
* @link https://php.net/manual/en/mysqli.commit.php
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @param int $flags [optional] A bitmask of MYSQLI_TRANS_COR_* constants
* @param string $name [optional] If provided then COMMITname is executed
* @param string|null $name [optional] If provided then COMMITname is executed
* @return bool
*/
function mysqli_commit (mysqli $mysql, int $flags = -1, string $name): bool
function mysqli_commit (mysqli $mysql, int $flags = -1, ?string $name): bool
{}
/**
* Open a new connection to the MySQL server
* Alias of <b>mysqli::__construct</b>
* @link https://php.net/manual/en/mysqli.construct.php
* @param string $hostname Can be either a host name or an IP address. Passing the NULL value or the string "localhost" to this parameter, the local host is assumed. When possible, pipes will be used instead of the TCP/IP protocol.
* @param string $username The MySQL user name.
* @param string $password If not provided or NULL, the MySQL server will attempt to authenticate the user against those user records which have no password only.
* @param string $database If provided will specify the default database to be used when performing queries.
* @param int $port Specifies the port number to attempt to connect to the MySQL server.
* @param string $socket Specifies the socket or named pipe that should be used.
* @param string|null $hostname Can be either a host name or an IP address. Passing the NULL value or the string "localhost" to this parameter, the local host is assumed. When possible, pipes will be used instead of the TCP/IP protocol.
* @param string|null $username The MySQL user name.
* @param string|null $password If not provided or NULL, the MySQL server will attempt to authenticate the user against those user records which have no password only.
* @param string|null $database If provided will specify the default database to be used when performing queries.
* @param int|null $port Specifies the port number to attempt to connect to the MySQL server.
* @param string|null $socket Specifies the socket or named pipe that should be used.
* @return mysqli|false|null object which represents the connection to a MySQL Server or false if an error occurred.
*/
function mysqli_connect (string $hostname, string $username, string $password, string $database, int $port, string $socket): mysqli|false|null
function mysqli_connect (?string $hostname, ?string $username, ?string $password, ?string $database, ?int $port, ?string $socket): mysqli|false|null
{}
/**
@ -1568,9 +1568,9 @@ function mysqli_connect_errno (): int
/**
* Returns a string description of the last connect error
* @link https://php.net/manual/en/mysqli.connect-error.php
* @return string Last error message string from the last call to mysqli_connect().
* @return string|null Last error message string from the last call to mysqli_connect().
*/
function mysqli_connect_error (): string
function mysqli_connect_error (): ?string
{}
/**
@ -1633,9 +1633,9 @@ function mysqli_stmt_error_list (mysqli_stmt $statement): array {}
* Returns a string description of the last error
* @link https://secure.php.net/manual/en/mysqli.error.php
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return string
* @return string|null
*/
function mysqli_error (mysqli $mysql): string {}
function mysqli_error (mysqli $mysql): ?string {}
/**
* Executes a prepared Query
@ -1718,13 +1718,13 @@ function mysqli_fetch_array (mysqli_result $result, int $mode = MYSQLI_BOTH): ar
* @link https://php.net/manual/en/mysqli-result.fetch-assoc.php
* @param mysqli_result $result A result set identifier returned by mysqli_query(),
* mysqli_store_result() or mysqli_use_result().
* @return string[] Returns an associative array of strings representing the fetched row in the result set,
* @return string[]|null Returns an associative array of strings representing the fetched row in the result set,
* where each key in the array represents the name of one of the result set's columns or NULL if there are no more rows in resultset.
* If two or more columns of the result have the same field names, the last column will take precedence.
* To access the other column(s) of the same name,
* you either need to access the result with numeric indices by using mysqli_fetch_row() or add alias names.
*/
function mysqli_fetch_assoc (mysqli_result $result): array {}
function mysqli_fetch_assoc (mysqli_result $result): ?array {}
/**
* Returns the current row of a result set as an object.
@ -1733,23 +1733,23 @@ function mysqli_fetch_assoc (mysqli_result $result): array {}
* mysqli_store_result() or mysqli_use_result().
* @param string $class The name of the class to instantiate, set the properties of and return. If not specified, a stdClass object is returned.
* @param array|null $constructor_args [optional] An optional array of parameters to pass to the constructor for class_name objects.
* @return object Returns an object with string properties that corresponds to the fetched row or NULL if there are no more rows in resultset.
* @return object|null Returns an object with string properties that corresponds to the fetched row or NULL if there are no more rows in resultset.
* If two or more columns of the result have the same field names, the last column will take precedence.
* To access the other column(s) of the same name,
* you either need to access the result with numeric indices by using mysqli_fetch_row() or add alias names.
*/
function mysqli_fetch_object (mysqli_result $result, string $class = 'stdClass', array $constructor_args): object {}
function mysqli_fetch_object (mysqli_result $result, string $class = 'stdClass', array $constructor_args): ?object {}
/**
* Get a result row as an enumerated array
* @link https://php.net/manual/en/mysqli-result.fetch-row.php
* @param mysqli_result $result A result set identifier returned by mysqli_query(),
* mysqli_store_result() or mysqli_use_result().
* @return array mysqli_fetch_row returns an array of strings that corresponds to the fetched row
* @return array|null mysqli_fetch_row returns an array of strings that corresponds to the fetched row
* or null if there are no more rows in result set.
* @link https://php.net/manual/en/mysqli-result.fetch-row.php
*/
function mysqli_fetch_row (mysqli_result $result): array {}
function mysqli_fetch_row (mysqli_result $result): ?array {}
/**
* Returns the number of columns for the most recent query
@ -1818,17 +1818,17 @@ function mysqli_get_client_stats () {}
* Returns a character set object
* @link https://php.net/manual/en/mysqli.get-charset.php
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return object
* @return object|null
*/
function mysqli_get_charset (mysqli $mysql): object {}
function mysqli_get_charset (mysqli $mysql): ?object {}
/**
* Get MySQL client info
* @link https://php.net/manual/en/mysqli.get-client-info.php
* @param mysqli $mysql [optional] A link identifier returned by mysqli_connect() or mysqli_init()
* @return string A string that represents the MySQL client library version
* @param mysqli|null $mysql [optional] A link identifier returned by mysqli_connect() or mysqli_init()
* @return string|null A string that represents the MySQL client library version
*/
function mysqli_get_client_info (mysqli $mysql): string {}
function mysqli_get_client_info (?mysqli $mysql): ?string {}
/**
* Returns the MySQL client version as an integer
@ -1934,9 +1934,9 @@ function mysqli_init (): mysqli|false {}
* Retrieves information about the most recently executed query
* @link https://php.net/manual/en/mysqli.info.php
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return string A character string representing additional information about the most recently executed query.
* @return string|null A character string representing additional information about the most recently executed query.
*/
function mysqli_info (mysqli $mysql): string {}
function mysqli_info (mysqli $mysql): ?string {}
/**
* Returns the auto generated id used in the last query
@ -2049,14 +2049,14 @@ function mysqli_ping (mysqli $mysql): bool
/**
* Poll connections
* @link https://php.net/manual/en/mysqli.poll.php
* @param array &$read
* @param array &$write
* @param array|null &$read
* @param array|null &$write
* @param array &$error
* @param int $seconds
* @param int $microseconds [optional]
* @return int|false number of ready connections upon success, FALSE otherwise.
*/
function mysqli_poll (array &$read, array &$write, array &$error, int $seconds, int $microseconds = 0): int|false
function mysqli_poll (?array &$read, ?array &$write, array &$error, int $seconds, int $microseconds = 0): int|false
{}
/**
@ -2128,16 +2128,16 @@ function mysqli_query (mysqli $mysql, string $query, int $result_mode = MYSQLI_S
* @link https://php.net/manual/en/mysqli.real-connect.php
* @see mysqli_connect()
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @param string $hostname [optional]
* @param string $username [optional]
* @param string $password [optional]
* @param string $database [optional]
* @param int $port [optional]
* @param string $socket [optional]
* @param string|null $hostname [optional]
* @param string|null $username [optional]
* @param string|null $password [optional]
* @param string|null $database [optional]
* @param int|null $port [optional]
* @param string|null $socket [optional]
* @param int $flags [optional]
* @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): bool
{}
/**
@ -2188,10 +2188,10 @@ function mysqli_release_savepoint (mysqli $mysql, string $name): bool
* @link https://php.net/manual/en/mysqli.rollback.php
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @param int $flags [optional] A bitmask of MYSQLI_TRANS_COR_* constants
* @param string $name [optional] If provided then ROLLBACKname is executed
* @param string|null $name [optional] If provided then ROLLBACKname is executed
* @return bool
*/
function mysqli_rollback (mysqli $mysql, int $flags = 0, string $name): bool
function mysqli_rollback (mysqli $mysql, int $flags = 0, ?string $name): bool
{}
/**
@ -2422,9 +2422,9 @@ function mysqli_stmt_param_count (mysqli_stmt $statement): int
* Returns the SQLSTATE error from previous MySQL operation
* @link https://php.net/manual/en/mysqli.sqlstate.php
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return string Returns a string containing the SQLSTATE error code for the last error. The error code consists of five characters. '00000' means no error.
* @return string|null Returns a string containing the SQLSTATE error code for the last error. The error code consists of five characters. '00000' means no error.
*/
function mysqli_sqlstate (mysqli $mysql): string
function mysqli_sqlstate (mysqli $mysql): ?string
{}
/**
@ -2481,9 +2481,9 @@ function mysqli_stmt_errno (mysqli_stmt $statement): int
* Returns a string description for last statement error
* @link https://php.net/manual/en/mysqli-stmt.error.php
* @param mysqli_stmt $statement
* @return string
* @return string|null
*/
function mysqli_stmt_error (mysqli_stmt $statement): string
function mysqli_stmt_error (mysqli_stmt $statement): ?string
{}
/**
@ -2517,9 +2517,9 @@ function mysqli_stmt_num_rows (mysqli_stmt $statement): string|int
* Returns SQLSTATE error from previous statement operation
* @link https://php.net/manual/en/mysqli-stmt.sqlstate.php
* @param mysqli_stmt $statement
* @return string Returns a string containing the SQLSTATE error code for the last error. The error code consists of five characters. '00000' means no error.
* @return string|null Returns a string containing the SQLSTATE error code for the last error. The error code consists of five characters. '00000' means no error.
*/
function mysqli_stmt_sqlstate (mysqli_stmt $statement): string
function mysqli_stmt_sqlstate (mysqli_stmt $statement): ?string
{}
/**

View File

@ -18,7 +18,7 @@ function openssl_pkey_free(#[LanguageLevelTypeAware(["8.0" => "OpenSSLAsymmetric
/**
* Generates a new private key
* @link https://php.net/manual/en/function.openssl-pkey-new.php
* @param array $options [optional] <p>
* @param array|null $options [optional] <p>
* You can finetune the key generation (such as specifying the number of
* bits) using <i>configargs</i>. See
* <b>openssl_csr_new</b> for more information about
@ -28,7 +28,7 @@ function openssl_pkey_free(#[LanguageLevelTypeAware(["8.0" => "OpenSSLAsymmetric
* error.
*/
#[LanguageLevelTypeAware(["8.0" => "OpenSSLAsymmetricKey|false"], default: "resource|false")]
function openssl_pkey_new(array $options): bool
function openssl_pkey_new(?array $options): bool
{ }
/**
@ -36,10 +36,10 @@ function openssl_pkey_new(array $options): bool
* @link https://php.net/manual/en/function.openssl-pkey-export.php
* @param mixed $key
* @param string &$output
* @param string $passphrase [optional] <p>
* @param string|null $passphrase [optional] <p>
* The key is optionally protected by <i>passphrase</i>.
* </p>
* @param array $options [optional] <p>
* @param array|null $options [optional] <p>
* <i>configargs</i> can be used to fine-tune the export
* process by specifying and/or overriding options for the openssl
* configuration file. See <b>openssl_csr_new</b> for more
@ -47,7 +47,7 @@ function openssl_pkey_new(array $options): bool
* </p>
* @return bool true on success or false on failure.
*/
function openssl_pkey_export($key, &$output, string $passphrase, array $options): bool
function openssl_pkey_export($key, &$output, ?string $passphrase, ?array $options): bool
{ }
/**
@ -57,11 +57,11 @@ function openssl_pkey_export($key, &$output, string $passphrase, array $options)
* @param string $output_filename <p>
* Path to the output file.
* </p>
* @param string $passphrase [optional] <p>
* @param string|null $passphrase [optional] <p>
* The key can be optionally protected by a
* <i>passphrase</i>.
* </p>
* @param array $options [optional] <p>
* @param array|null $options [optional] <p>
* <i>configargs</i> can be used to fine-tune the export
* process by specifying and/or overriding options for the openssl
* configuration file. See <b>openssl_csr_new</b> for more
@ -69,7 +69,7 @@ function openssl_pkey_export($key, &$output, string $passphrase, array $options)
* </p>
* @return bool true on success or false on failure.
*/
function openssl_pkey_export_to_file($key, string $output_filename, string $passphrase, array $options): bool
function openssl_pkey_export_to_file($key, string $output_filename, ?string $passphrase, ?array $options): bool
{ }
/**
@ -85,14 +85,14 @@ function openssl_pkey_export_to_file($key, string $output_filename, string $pass
* </li>
* <li>A PEM formatted private key.</li>
* </ol></p>
* @param string $passphrase [optional] <p>
* @param string|null $passphrase [optional] <p>
* The optional parameter <b><em>passphrase</em></b> must be used
* if the specified key is encrypted (protected by a passphrase).
* </p>
* @return OpenSSLAsymmetricKey|resource|false Returns a positive key resource identifier on success, or <b>FALSE</b> on error.
*/
#[LanguageLevelTypeAware(["8.0" => "OpenSSLAsymmetricKey|false"], default: "resource|false")]
function openssl_pkey_get_private($private_key, string $passphrase = ""): bool
function openssl_pkey_get_private($private_key, ?string $passphrase = ""): bool
{ }
/**
@ -158,14 +158,14 @@ function openssl_free_key(#[LanguageLevelTypeAware(["8.0" => "OpenSSLAsymmetricK
* </li>
* <li>A PEM formatted private key.</li>
* </ol></p>
* @param $passphrase [optional] <p>
* @param string|null $passphrase [optional] <p>
* The optional parameter <b><em>passphrase</em></b> must be used
* if the specified key is encrypted (protected by a passphrase).
* </p>
* @return OpenSSLAsymmetricKey|resource|false Returns a positive key resource identifier on success, or <b>FALSE</b> on error.
*/
#[LanguageLevelTypeAware(["8.0" => "OpenSSLAsymmetricKey|false"], default: "resource|false")]
function openssl_get_privatekey($private_key, string $passphrase): bool
function openssl_get_privatekey($private_key, ?string $passphrase): bool
{ }
/**
@ -333,7 +333,7 @@ function openssl_x509_parse(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertifica
* as described in Certificate
* Verification.
* </p>
* @param string $untrusted_certificates_file [optional] <p>
* @param string|null $untrusted_certificates_file [optional] <p>
* If specified, this should be the name of a PEM encoded file holding
* certificates that can be used to help verify the certificate, although
* no trust is placed in the certificates that come from that file.
@ -341,7 +341,7 @@ function openssl_x509_parse(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertifica
* @return int|bool true if the certificate can be used for the intended purpose,
* false if it cannot, or -1 on error.
*/
function openssl_x509_checkpurpose(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, int $purpose, array $ca_info, string $untrusted_certificates_file): int|bool
function openssl_x509_checkpurpose(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, int $purpose, array $ca_info, ?string $untrusted_certificates_file): int|bool
{ }
/**
@ -464,7 +464,7 @@ function openssl_pkcs12_read(string $pkcs12, &$certificates, string $passphrase)
* The corresponding public portion of the key will be used to sign the
* CSR.
* </p>
* @param array $options [optional] <p>
* @param array|null $options [optional] <p>
* By default, the information in your system openssl.conf
* is used to initialize the request; you can specify a configuration file
* section by setting the config_section_section key of
@ -536,7 +536,7 @@ function openssl_pkcs12_read(string $pkcs12, &$certificates, string $passphrase)
* </tr>
* </table>
* </p>
* @param array $extra_attributes [optional] <p>
* @param array|null $extra_attributes [optional] <p>
* <i>extraattribs</i> is used to specify additional
* configuration options for the CSR. Both <i>dn</i> and
* <i>extraattribs</i> are associative arrays whose keys are
@ -545,7 +545,7 @@ function openssl_pkcs12_read(string $pkcs12, &$certificates, string $passphrase)
* @return OpenSSLCertificateSigningRequest|false|resource the CSR.
*/
#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificateSigningRequest|false"], default: "resource|false")]
function openssl_csr_new(array $distinguished_names, &$private_key, array $options, array $extra_attributes)
function openssl_csr_new(array $distinguished_names, &$private_key, ?array $options, ?array $extra_attributes)
{ }
/**
@ -594,7 +594,7 @@ function openssl_csr_export_to_file(#[LanguageLevelTypeAware(["8.0" => "OpenSSLC
* <i>days</i> specifies the length of time for which the
* generated certificate will be valid, in days.
* </p>
* @param array $options [optional] <p>
* @param array|null $options [optional] <p>
* You can finetune the CSR signing by <i>configargs</i>.
* See <b>openssl_csr_new</b> for more information about
* <i>configargs</i>.
@ -606,7 +606,7 @@ function openssl_csr_export_to_file(#[LanguageLevelTypeAware(["8.0" => "OpenSSLC
* @return OpenSSLCertificate|resource|false an x509 certificate resource on success, false on failure.
*/
#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|false"], default: "resource|false")]
function openssl_csr_sign(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificateSigningRequest|string"], default: "resource|string")] $csr, #[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string|null"], default: "resource|string|null")] $ca_certificate, $private_key, int $days, array $options, int $serial = 0)
function openssl_csr_sign(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificateSigningRequest|string"], default: "resource|string")] $csr, #[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string|null"], default: "resource|string|null")] $ca_certificate, $private_key, int $days, ?array $options, int $serial = 0)
{ }
/**
@ -777,10 +777,10 @@ function openssl_seal(string $data, &$sealed_data, &$encrypted_keys, array $publ
* @param string $encrypted_key
* @param mixed $private_key
* @param string $cipher_algo [optional] The cipher method.
* @param string $iv [optional] The initialization vector.
* @param string|null $iv [optional] The initialization vector.
* @return bool true on success or false on failure.
*/
function openssl_open(string $data, &$output, string $encrypted_key, $private_key, string $cipher_algo = "RC4", string $iv): bool
function openssl_open(string $data, &$output, string $encrypted_key, $private_key, string $cipher_algo = "RC4", ?string $iv): bool
{ }
/**
@ -808,7 +808,7 @@ function openssl_pbkdf2(string $password, string $salt, int $key_length, int $it
* verified - see PKCS7 constants
* for more information.
* </p>
* @param string $signers_certificates_filename [optional] <p>
* @param string|null $signers_certificates_filename [optional] <p>
* If the <i>outfilename</i> is specified, it should be a
* string holding the name of a file into which the certificates of the
* persons that signed the messages will be stored in PEM format.
@ -819,11 +819,11 @@ function openssl_pbkdf2(string $password, string $salt, int $key_length, int $it
* process - see certificate
* verification for more information about this parameter.
* </p>
* @param string $untrusted_certificates_filename [optional] <p>
* @param string|null $untrusted_certificates_filename [optional] <p>
* If the <i>extracerts</i> is specified, it is the filename
* of a file containing a bunch of certificates to use as untrusted CAs.
* </p>
* @param string $content [optional] <p>
* @param string|null $content [optional] <p>
* You can specify a filename with <i>content</i> that will
* be filled with the verified data, but with the signature information
* stripped.
@ -833,7 +833,7 @@ function openssl_pbkdf2(string $password, string $salt, int $key_length, int $it
* (the message has been tampered with, or the signing certificate is invalid),
* or -1 on error.
*/
function openssl_pkcs7_verify(string $input_filename, int $flags, string $signers_certificates_filename, array $ca_info, string $untrusted_certificates_filename, string $content, string $output_filename): int|bool
function openssl_pkcs7_verify(string $input_filename, int $flags, ?string $signers_certificates_filename, array $ca_info, ?string $untrusted_certificates_filename, ?string $content, ?string $output_filename): int|bool
{ }
/**
@ -858,7 +858,7 @@ function openssl_pkcs7_decrypt(string $input_filename, string $output_filename,
* @param string $output_filename
* @param OpenSSLCertificate|string|resource $certificate
* @param mixed $private_key
* @param array $headers <p>
* @param array|null $headers <p>
* <i>headers</i> is an array of headers that
* will be prepended to the data after it has been signed (see
* <b>openssl_pkcs7_encrypt</b> for more information about
@ -867,14 +867,14 @@ function openssl_pkcs7_decrypt(string $input_filename, string $output_filename,
* @param int $flags [optional] <p>
* <i>flags</i> can be used to alter the output - see PKCS7 constants.
* </p>
* @param string $untrusted_certificates_filename [optional] <p>
* @param string|null $untrusted_certificates_filename [optional] <p>
* <i>extracerts</i> specifies the name of a file containing
* a bunch of extra certificates to include in the signature which can for
* example be used to help the recipient to verify the certificate that you used.
* </p>
* @return bool true on success or false on failure.
*/
function openssl_pkcs7_sign(string $input_filename, string $output_filename, #[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, $private_key, array $headers, int $flags = PKCS7_DETACHED, string $untrusted_certificates_filename): bool
function openssl_pkcs7_sign(string $input_filename, string $output_filename, #[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, $private_key, ?array $headers, int $flags = PKCS7_DETACHED, ?string $untrusted_certificates_filename): bool
{ }
/**
@ -885,7 +885,7 @@ function openssl_pkcs7_sign(string $input_filename, string $output_filename, #[L
* @param OpenSSLCertificate|string|resource $certificate <p>
* Either a lone X.509 certificate, or an array of X.509 certificates.
* </p>
* @param array $headers <p>
* @param array|null $headers <p>
* <i>headers</i> is an array of headers that
* will be prepended to the data after it has been encrypted.
* </p>
@ -904,7 +904,7 @@ function openssl_pkcs7_sign(string $input_filename, string $output_filename, #[L
* </p>
* @return bool true on success or false on failure.
*/
function openssl_pkcs7_encrypt(string $input_filename, string $output_filename, $certificate, array $headers, int $flags = 0, int $cipher_algo = OPENSSL_CIPHER_RC2_40): bool
function openssl_pkcs7_encrypt(string $input_filename, string $output_filename, $certificate, ?array $headers, int $flags = 0, int $cipher_algo = OPENSSL_CIPHER_RC2_40): bool
{ }
/**
@ -1085,17 +1085,17 @@ function openssl_pkcs7_read(string $input_filename, &$certificates): bool
* Verifies that the data block is intact, the signer is who they say they are, and returns the certs of the signers.
* @param string $input_filename
* @param int $flags [optional]
* @param string $certificates [optional]
* @param string|null $certificates [optional]
* @param array $ca_info [optional]
* @param string $untrusted_certificates_filename [optional]
* @param string $content [optional]
* @param string $pk7 [optional]
* @param string $sigfile [optional]
* @param string|null $untrusted_certificates_filename [optional]
* @param string|null $content [optional]
* @param string|null $pk7 [optional]
* @param string|null $sigfile [optional]
* @param int $encoding [optional]
* @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.
@ -1113,11 +1113,11 @@ function openssl_cms_encrypt(string $input_filename, string $output_filename, $c
* @param array|null $headers
* @param int $flags [optional]
* @param int $encoding [optional]
* @param string $untrusted_certificates_filename [optional]
* @param string|null $untrusted_certificates_filename [optional]
* @return bool
* @since 8.0
*/
function openssl_cms_sign(string $input_filename, string $output_filename, OpenSSLCertificate|string $certificate, $private_key, ?array $headers, int $flags = 0, int $encoding = OPENSSL_ENCODING_SMIME, string $untrusted_certificates_filename): bool {}
function openssl_cms_sign(string $input_filename, string $output_filename, OpenSSLCertificate|string $certificate, $private_key, ?array $headers, int $flags = 0, int $encoding = OPENSSL_ENCODING_SMIME, ?string $untrusted_certificates_filename): bool {}
/**
* Decrypts the S/MIME message in the file and outputs the results to the supplied file.

View File

@ -341,7 +341,7 @@ function pcntl_strerror (int $error_code): bool|string
/**
* Get the priority of any process
* @link https://php.net/manual/en/function.pcntl-getpriority.php
* @param int $process_id [optional] <p>
* @param int|null $process_id [optional] <p>
* If not specified, the pid of the current process (getmypid()) is used.
* </p>
* @param int $mode [optional] <p>
@ -353,7 +353,7 @@ function pcntl_strerror (int $error_code): bool|string
* scheduling.
*/
#[Pure]
function pcntl_getpriority (int $process_id, int $mode = PRIO_PROCESS): int|false
function pcntl_getpriority (?int $process_id, int $mode = PRIO_PROCESS): int|false
{}
/**
@ -367,7 +367,7 @@ function pcntl_getpriority (int $process_id, int $mode = PRIO_PROCESS): int|fals
* system types and kernel versions, please see your system's setpriority(2)
* man page for specific details.
* </p>
* @param int $process_id [optional] <p>
* @param int|null $process_id [optional] <p>
* If not specified, the pid of the current process (getmypid()) is used.
* </p>
* @param int $mode [optional] <p>
@ -376,7 +376,7 @@ function pcntl_getpriority (int $process_id, int $mode = PRIO_PROCESS): int|fals
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function pcntl_setpriority (int $priority, int $process_id, int $mode = PRIO_PROCESS): bool
function pcntl_setpriority (int $priority, ?int $process_id, int $mode = PRIO_PROCESS): bool
{}
/**
@ -473,14 +473,14 @@ function pcntl_sigtimedwait (array $signals, &$info, int $seconds = 0, int $nano
* signal handling is enabled.
* @link https://www.php.net/manual/en/function.pcntl-async-signals.php
*
* @param bool $enable [optional] <p>
* @param bool|null $enable [optional] <p>
* Whether asynchronous signal handling should be enabled.
* </p>
*
* @return bool
* @since 7.1
*/
function pcntl_async_signals(bool $enable): bool
function pcntl_async_signals(?bool $enable): bool
{}
/**

View File

@ -449,7 +449,7 @@ function preg_split (string $pattern, string $subject, int $limit = -1, int $fla
* @param string $str <p>
* The input string.
* </p>
* @param string $delimiter [optional] <p>
* @param string|null $delimiter [optional] <p>
* If the optional <i>delimiter</i> is specified, it
* will also be escaped. This is useful for escaping the delimiter
* that is required by the PCRE functions. The / is the most commonly
@ -458,7 +458,7 @@ function preg_split (string $pattern, string $subject, int $limit = -1, int $fla
* @return string the quoted (escaped) string.
*/
#[Pure]
function preg_quote (string $str, string $delimiter): string
function preg_quote (string $str, ?string $delimiter): string
{}
/**

View File

@ -5,18 +5,18 @@
/**
* Reads a line
* @link https://php.net/manual/en/function.readline.php
* @param string $prompt [optional] <p>
* @param string|null $prompt [optional] <p>
* You may specify a string with which to prompt the user.
* </p>
* @return string|false a single string from the user. The line returned has the ending newline removed.
* If there is no more data to read, then FALSE is returned.
*/
function readline (string $prompt): string|false {}
function readline (?string $prompt): string|false {}
/**
* Gets/sets various internal readline variables
* @link https://php.net/manual/en/function.readline-info.php
* @param string $var_name [optional] <p>
* @param string|null $var_name [optional] <p>
* A variable name.
* </p>
* @param string $value [optional] <p>
@ -31,7 +31,7 @@ function readline (string $prompt): string|false {}
* <p>
* If called with one or two parameters, the old value is returned.
*/
function readline_info (string $var_name, $value): mixed {}
function readline_info (?string $var_name, $value): mixed {}
/**
* Adds a line to the history
@ -64,23 +64,23 @@ function readline_list_history (): array
/**
* Reads the history
* @link https://php.net/manual/en/function.readline-read-history.php
* @param string $filename [optional] <p>
* @param string|null $filename [optional] <p>
* Path to the filename containing the command history.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function readline_read_history (string $filename): bool
function readline_read_history (?string $filename): bool
{}
/**
* Writes the history
* @link https://php.net/manual/en/function.readline-write-history.php
* @param string $filename [optional] <p>
* @param string|null $filename [optional] <p>
* Path to the saved file.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function readline_write_history (string $filename): bool
function readline_write_history (?string $filename): bool
{}
/**

View File

@ -7,7 +7,7 @@ use JetBrains\PhpStorm\Deprecated;
* Get and/or set the current session name.<br/>
* Before 7.2.0 checked cookie status and since 7.2.0 checks both cookie and session status to avoid PHP crash.
* @link https://php.net/manual/en/function.session-name.php
* @param string $name [optional] <p>
* @param string|null $name [optional] <p>
* The session name references the name of the session, which is
* used in cookies and URLs (e.g. PHPSESSID). It
* should contain only alphanumeric characters; it should be short and
@ -23,26 +23,26 @@ use JetBrains\PhpStorm\Deprecated;
* </p>
* @return string|false the name of the current session.
*/
function session_name (string $name): string|false
function session_name (?string $name): string|false
{}
/**
* Get and/or set the current session module.<br/>
* Since 7.2.0 it is forbidden to set the module name to "user".
* @link https://php.net/manual/en/function.session-module-name.php
* @param string $module [optional] <p>
* @param string|null $module [optional] <p>
* If <i>module</i> is specified, that module will be
* used instead.
* </p>
* @return string|false the name of the current session module.
*/
function session_module_name (string $module): string|false
function session_module_name (?string $module): string|false
{}
/**
* Get and/or set the current session save path
* @link https://php.net/manual/en/function.session-save-path.php
* @param string $path [optional] <p>
* @param string|null $path [optional] <p>
* Session data path. If specified, the path to which data is saved will
* be changed. <b>session_save_path</b> needs to be called
* before <b>session_start</b> for that purpose.
@ -56,13 +56,13 @@ function session_module_name (string $module): string|false
* </p>
* @return string|false the path of the current directory used for data storage.
*/
function session_save_path (string $path): string|false
function session_save_path (?string $path): string|false
{}
/**
* Get and/or set the current session id
* @link https://php.net/manual/en/function.session-id.php
* @param string $id [optional] <p>
* @param string|null $id [optional] <p>
* If <i>id</i> is specified, it will replace the current
* session id. <b>session_id</b> needs to be called before
* <b>session_start</b> for that purpose. Depending on the
@ -78,7 +78,7 @@ function session_save_path (string $path): string|false
* session or the empty string ("") if there is no current
* session (no current session id exists).
*/
function session_id (string $id): string|false
function session_id (?string $id): string|false
{}
/**
@ -277,7 +277,7 @@ function session_set_save_handler (SessionHandlerInterface $session_handler, $re
/**
* Get and/or set the current cache limiter
* @link https://php.net/manual/en/function.session-cache-limiter.php
* @param string $value [optional] <p>
* @param string|null $value [optional] <p>
* If <i>cache_limiter</i> is specified, the name of the
* current cache limiter is changed to the new value.
* </p>
@ -329,13 +329,13 @@ function session_set_save_handler (SessionHandlerInterface $session_handler, $re
* </table>
* @return string|false the name of the current cache limiter.
*/
function session_cache_limiter (string $value): string|false
function session_cache_limiter (?string $value): string|false
{}
/**
* Return current cache expire
* @link https://php.net/manual/en/function.session-cache-expire.php
* @param int $value [optional] <p>
* @param int|null $value [optional] <p>
* If <i>new_cache_expire</i> is given, the current cache
* expire is replaced with <i>new_cache_expire</i>.
* </p>
@ -347,7 +347,7 @@ function session_cache_limiter (string $value): string|false
* @return int|false the current setting of session.cache_expire.
* The value returned should be read in minutes, defaults to 180.
*/
function session_cache_expire (int $value): int|false
function session_cache_expire (?int $value): int|false
{}
/**
@ -376,28 +376,28 @@ function session_set_cookie_params (array $options): bool
* Lifetime of the
* session cookie, defined in seconds.
* </p>
* @param string $path [optional] <p>
* @param string|null $path [optional] <p>
* Path on the domain where
* the cookie will work. Use a single slash ('/') for all paths on the
* domain.
* </p>
* @param string $domain [optional] <p>
* @param string|null $domain [optional] <p>
* Cookie domain, for
* example 'www.php.net'. To make cookies visible on all subdomains then
* the domain must be prefixed with a dot like '.php.net'.
* </p>
* @param bool $secure [optional] <p>
* @param bool|null $secure [optional] <p>
* If true cookie will only be sent over
* secure connections.
* </p>
* @param bool $httponly [optional] <p>
* @param bool|null $httponly [optional] <p>
* If set to true then PHP will attempt to send the
* httponly
* flag when setting the session cookie.
* </p>
* @return void|bool since 7.2.0 returns true on success or false on failure.
*/
function session_set_cookie_params (array|int $lifetime_or_options, string $path, string $domain, bool $secure = false, bool $httponly = false): bool
function session_set_cookie_params (array|int $lifetime_or_options, ?string $path, ?string $domain, ?bool $secure = false, ?bool $httponly = false): bool
{}
/**

View File

@ -56,11 +56,11 @@ function cli_set_process_title (string $title): bool
/**
* Returns the current process title
* @link https://php.net/manual/en/function.cli-get-process-title.php
* @return string Return a string with the current process title or <b>NULL</b> on error.
* @return string|null Return a string with the current process title or <b>NULL</b> on error.
* @since 5.5
*/
#[Pure]
function cli_get_process_title (): string
function cli_get_process_title (): ?string
{}
/**

View File

@ -145,7 +145,7 @@ define('PASSWORD_ARGON2_PROVIDER', 'standard');
* Returns information about the given hash
* @link https://secure.php.net/manual/en/function.password-get-info.php
* @param string $hash A hash created by password_hash().
* @return array Returns an associative array with three elements:
* @return array|null Returns an associative array with three elements:
* <ul>
* <li>
* <em>algo</em>, which will match a
@ -162,7 +162,7 @@ define('PASSWORD_ARGON2_PROVIDER', 'standard');
* @since 5.5
*/
#[ArrayShape(["algo" => "int", "algoName" => "string", "options" => "array"])]
function password_get_info (string $hash): array
function password_get_info (string $hash): ?array
{}
/**

View File

@ -399,7 +399,7 @@ function wordwrap (string $string, int $width = 75, string $break = "\n", bool $
* </tbody>
*
* </table>
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <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.
@ -421,7 +421,7 @@ function wordwrap (string $string, int $width = 75, string $break = "\n", bool $
* @return string The converted string.
*/
#[Pure]
function htmlspecialchars (string $string, int $flags = ENT_COMPAT | ENT_HTML401, string $encoding = 'UTF-8', bool $double_encode = true): string
function htmlspecialchars (string $string, int $flags = ENT_COMPAT | ENT_HTML401, ?string $encoding = 'UTF-8', bool $double_encode = true): string
{}
/**
@ -455,7 +455,7 @@ function htmlspecialchars (string $string, int $flags = ENT_COMPAT | ENT_HTML401
* </tr>
* </table>
* </p>
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* Like htmlspecialchars, it takes an optional
* third argument charset which defines character
* set used in conversion.
@ -469,7 +469,7 @@ function htmlspecialchars (string $string, int $flags = ENT_COMPAT | ENT_HTML401
* @return string the encoded string.
*/
#[Pure]
function htmlentities (string $string, int $flags, string $encoding, bool $double_encode = true): string
function htmlentities (string $string, int $flags, ?string $encoding, bool $double_encode = true): string
{}
/**
@ -503,7 +503,7 @@ function htmlentities (string $string, int $flags, string $encoding, bool $doubl
* </tr>
* </table>
* </p>
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* The ISO-8859-1 character set is used as default for the optional third
* charset. This defines the character set used in
* conversion.
@ -512,7 +512,7 @@ function htmlentities (string $string, int $flags, string $encoding, bool $doubl
* @return string the decoded string.
*/
#[Pure]
function html_entity_decode (string $string, int $flags, string $encoding): string
function html_entity_decode (string $string, int $flags, ?string $encoding): string
{}
/**
@ -1101,7 +1101,7 @@ function phpinfo (int $flags): bool
/**
* Gets the current PHP version
* @link https://php.net/manual/en/function.phpversion.php
* @param string $extension [optional] <p>
* @param string|null $extension [optional] <p>
* An optional extension name.
* </p>
* @return string|false If the optional extension parameter is
@ -1110,7 +1110,7 @@ function phpinfo (int $flags): bool
* the extension isn't enabled.
*/
#[Pure]
function phpversion (string $extension): string|false
function phpversion (?string $extension): string|false
{}
/**
@ -1316,7 +1316,7 @@ function strnatcasecmp (string $string1, string $string2): int
* @param int $offset [optional] <p>
* The offset where to start counting
* </p>
* @param int $length [optional] <p>
* @param int|null $length [optional] <p>
* The maximum length after the specified offset to search for the
* substring. It outputs a warning if the offset plus the length is
* greater than the haystack length.
@ -1324,7 +1324,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, ?int $length): int
{}
/**
@ -1358,7 +1358,7 @@ function substr_count (string $haystack, string $needle, int $offset, int $lengt
* the start'th position from the end
* of subject.
* </p>
* @param int $length [optional] <p>
* @param int|null $length [optional] <p>
* The length of the segment from subject
* to examine.
* </p>
@ -1378,7 +1378,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, ?int $length): int
{}
/**
@ -1393,13 +1393,13 @@ function strspn (string $string, string $characters, int $offset, int $length):
* @param int $offset [optional] <p>
* The start position of the string to examine.
* </p>
* @param int $length [optional] <p>
* @param int|null $length [optional] <p>
* The length of the string to examine.
* </p>
* @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, ?int $length): int
{}
/**
@ -1413,10 +1413,10 @@ function strcspn (string $string, string $characters, int $offset, int $length):
* @param string $string [optional] <p>
* The string being split up into smaller strings (tokens).
* </p>
* @param string $token <p>
* @param string|null $token <p>
* The delimiter used when splitting up str.
* </p>
* @return string|false A string token.
*/
function strtok (string $string, string $token): string|false
function strtok (string $string, ?string $token): string|false
{}

View File

@ -391,14 +391,14 @@ function str_shuffle (string $string): string
* are:
* 0 - returns the number of words found
* </p>
* @param string $characters [optional] <p>
* @param string|null $characters [optional] <p>
* A list of additional characters which will be considered as 'word'
* </p>
* @return string[]|int an array or an integer, depending on the
* format chosen.
*/
#[Pure]
function str_word_count (string $string, int $format, string $characters): array|int
function str_word_count (string $string, int $format, ?string $characters): array|int
{}
/**
@ -456,7 +456,7 @@ function strpbrk (string $string, string $characters): string|false
* The start position for the comparison. If negative, it starts counting
* from the end of the string.
* </p>
* @param int $length [optional] <p>
* @param int|null $length [optional] <p>
* The length of the comparison.
* </p>
* @param bool $case_insensitive [optional] <p>
@ -472,7 +472,7 @@ function strpbrk (string $string, string $characters): string|false
* false.
*/
#[Pure]
function substr_compare (string $haystack, string $needle, int $offset, int $length, bool $case_insensitive): int
function substr_compare (string $haystack, string $needle, int $offset, ?int $length, bool $case_insensitive): int
{}
/**
@ -547,7 +547,7 @@ function money_format (string $format, float $number): ?string
* $rest = substr("abcdef", -3, 1); // returns "d"
* ?>
* </pre>
* @param int $length [optional] <p>
* @param int|null $length [optional] <p>
* If length is given and is positive, the string
* returned will contain at most length characters
* beginning from start (depending on the length of
@ -578,7 +578,7 @@ function money_format (string $format, float $number): ?string
*/
#[Pure]
#[LanguageLevelTypeAware(["8.0" => "string"], default: "string|false")]
function substr (string $string, int $offset, int $length): bool|string
function substr (string $string, int $offset, ?int $length)
{}
/**
@ -1042,14 +1042,14 @@ function explode (string $separator, string $string, int $limit): array|bool
* implode as glue would be
* the second parameter and thus, the bad prototype would be used.
* </p>
* @param array $array <p>
* @param array|null $array <p>
* The array of strings to implode.
* </p>
* @return string a string containing a string representation of all the array
* elements in the same order, with the glue string between each element.
*/
#[Pure]
function implode (array|string $separator = "", array $array): string
function implode (array|string $separator = "", ?array $array): string
{}
/**
@ -1060,14 +1060,14 @@ function implode (array|string $separator = "", array $array): string
* implode as glue would be
* the second parameter and thus, the bad prototype would be used.
* </p>
* @param array $array <p>
* @param array|null $array <p>
* The array of strings to implode.
* </p>
* @return string a string containing a string representation of all the array
* elements in the same order, with the glue string between each element.
*/
#[Pure]
function join (array|string $separator = "", array $array): string
function join (array|string $separator = "", ?array $array): string
{}
/**

View File

@ -591,7 +591,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 $arg_separator [optional] <p>
* @param string|null $arg_separator [optional] <p>
* arg_separator.output
* is used to separate arguments, unless this parameter is specified,
* and is then used.
@ -603,7 +603,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 = "&", int $encoding_type = PHP_QUERY_RFC1738): string
{}
/**
@ -749,9 +749,9 @@ function escapeshellarg (string $arg): string
* If the return_var argument is present, the
* return status of the Unix command will be placed here.
* </p>
* @return bool
* @return bool|null
*/
function passthru (string $command, &$result_code): bool
function passthru (string $command, &$result_code): ?bool
{}
/**
@ -816,7 +816,7 @@ function shell_exec (string $command): string|false|null
* An array with the environment variables for the command that will be
* run, or null to use the same environment as the current PHP process
* </p>
* @param array $options [optional] <p>
* @param array|null $options [optional] <p>
* Allows you to specify additional options. Currently supported options
* include:
* suppress_errors (windows only): suppresses errors generated by this
@ -835,7 +835,7 @@ function shell_exec (string $command): string|false|null
* proc_close when you are finished with it. On failure
* returns false.
*/
function proc_open (array|string $command, array $descriptor_spec, &$pipes, string $cwd, array $env_vars, array $options)
function proc_open (array|string $command, array $descriptor_spec, &$pipes, ?string $cwd, ?array $env_vars, ?array $options)
{}
/**

View File

@ -710,12 +710,12 @@ function base_convert (string $num, int $from_base, int $to_base): string
* @param int $decimals [optional] <p>
* Sets the number of decimal points.
* </p>
* @param string $decimal_separator [optional]
* @param string $thousands_separator [optional]
* @param string|null $decimal_separator [optional]
* @param string|null $thousands_separator [optional]
* @return string A formatted version of number.
*/
#[Pure]
function number_format (float $num , int $decimals = 0 , string $decimal_separator = '.' , string $thousands_separator = ','): string
function number_format (float $num , int $decimals = 0 , ?string $decimal_separator = '.' , ?string $thousands_separator = ','): string
{}
/**
@ -797,7 +797,7 @@ function long2ip (int $ip): string|false
/**
* Gets the value of an environment variable
* @link https://php.net/manual/en/function.getenv.php
* @param string $name [optional] <p>
* @param string|null $name [optional] <p>
* The variable name.
* </p>
* @param bool $local_only [optional] <p>
@ -808,7 +808,7 @@ function long2ip (int $ip): string|false
* is provided, or false on an error.
*/
#[Pure]
function getenv (string $name, bool $local_only = false): array|string|false
function getenv (?string $name, bool $local_only = false): array|string|false
{}
/**
@ -1146,11 +1146,11 @@ function import_request_variables (string $types, $prefix = null): bool
* </tr>
* </table>
* </p>
* @param string $destination [optional] <p>
* @param string|null $destination [optional] <p>
* The destination. Its meaning depends on the
* message_type parameter as described above.
* </p>
* @param string $additional_headers [optional] <p>
* @param string|null $additional_headers [optional] <p>
* The extra headers. It's used when the message_type
* parameter is set to 1.
* This message type uses the same internal function as
@ -1158,6 +1158,6 @@ 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, ?string $destination, ?string $additional_headers): bool
{
}

View File

@ -299,9 +299,9 @@ function memory_get_peak_usage (bool $real_usage = false): int
* It is possible to pass parameters to the shutdown function by passing
* additional parameters.
* </p>
* @return bool
* @return bool|null
*/
function register_shutdown_function (callable $callback, ...$args): bool {}
function register_shutdown_function (callable $callback, ...$args): ?bool {}
/**
* Register a function for execution on each tick
@ -421,7 +421,7 @@ function ini_get (string $option): string|false
* Gets all configuration options
* @link https://php.net/manual/en/function.ini-get-all.php
* @link https://php.net/manual/en/ini.list.php
* @param string $extension [optional] <p>
* @param string|null $extension [optional] <p>
* An optional extension name. If set, the function return only options
* specific for that extension.
* </p>
@ -451,7 +451,7 @@ function ini_get (string $option): string|false
* why access shows the appropriate bitmask values.
*/
#[Pure]
function ini_get_all (string $extension, bool $details): array|false
function ini_get_all (?string $extension, bool $details): array|false
{}
/**
@ -705,13 +705,13 @@ function header (string $header, bool $replace = true, int $response_code): void
/**
* Remove previously set headers
* @link https://php.net/manual/en/function.header-remove.php
* @param string $name [optional] <p>
* @param string|null $name [optional] <p>
* The header name to be removed.
* </p>
* This parameter is case-insensitive.
* @return void
*/
function header_remove (string $name): void {}
function header_remove (?string $name): void {}
/**
* Checks if or where headers have been sent
@ -783,14 +783,14 @@ function connection_status (): int
/**
* Set whether a client disconnect should abort script execution
* @link https://php.net/manual/en/function.ignore-user-abort.php
* @param string $enable [optional] <p>
* @param bool|null $enable [optional] <p>
* If set, this function will set the ignore_user_abort ini setting
* to the given value. If not, this function will
* only return the previous setting without changing it.
* </p>
* @return int the previous setting, as an integer.
*/
function ignore_user_abort (bool $enable): int
function ignore_user_abort (?bool $enable): int
{}
/**

View File

@ -448,13 +448,13 @@ function rmdir (string $directory, $context): bool
/**
* Changes the current umask
* @link https://php.net/manual/en/function.umask.php
* @param int $mask [optional] <p>
* @param int|null $mask [optional] <p>
* The new umask.
* </p>
* @return int umask without arguments simply returns the
* current umask otherwise the old umask is returned.
*/
function umask (int $mask): int
function umask (?int $mask): int
{}
/**
@ -493,7 +493,7 @@ function fgetc ($stream): string|false
* Gets line from file pointer
* @link https://php.net/manual/en/function.fgets.php
* @param resource $stream The file pointer must be valid, and must point to a file successfully opened by fopen() or fsockopen() (and not yet closed by fclose()).
* @param int $length [optional] <p>
* @param int|null $length [optional] <p>
* Reading ends when length - 1 bytes have been
* read, on a newline (which is included in the return value), or on EOF
* (whichever comes first). If no length is specified, it will keep
@ -511,7 +511,7 @@ function fgetc ($stream): string|false
* <p>
* If an error occurs, returns false.
*/
function fgets ($stream, int $length): string|false
function fgets ($stream, ?int $length): string|false
{}
/**
@ -844,7 +844,7 @@ function fflush ($stream): bool
* @param string $data <p>
* The string that is to be written.
* </p>
* @param int $length [optional] <p>
* @param int|null $length [optional] <p>
* If the length argument is given, writing will
* stop after length bytes have been written or
* the end of string is reached, whichever comes
@ -858,7 +858,7 @@ function fflush ($stream): bool
* </p>
* @return int|false the number of bytes written, or <b>FALSE</b> on error.
*/
function fwrite ($stream, string $data, int $length): int|false
function fwrite ($stream, string $data, ?int $length): int|false
{}
/**
@ -867,7 +867,7 @@ function fwrite ($stream, string $data, int $length): int|false
* @param string $data <p>
* The string that is to be written.
* </p>
* @param int $length [optional] <p>
* @param int|null $length [optional] <p>
* If the length argument is given, writing will
* stop after length bytes have been written or
* the end of string is reached, whichever comes
@ -884,7 +884,7 @@ function fwrite ($stream, string $data, int $length): int|false
* @link https://php.net/manual/en/function.fputs.php
* Binary-safe file write
*/
function fputs ($stream, string $data, int $length): int|false
function fputs ($stream, string $data, ?int $length): int|false
{}
/**
@ -1033,13 +1033,13 @@ function file (string $filename, int $flags, $context): array|false
* @param int $offset [optional] <p>
* The offset where the reading starts.
* </p>
* @param int $length [optional] <p>
* @param int|null $length [optional] <p>
* Maximum length of data read. The default is to read until end
* of file is reached.
* </p>
* @return string|false The function returns the read data or false on failure.
*/
function file_get_contents (string $filename, bool $use_include_path = false, $context, int $offset = 0, int $length): string|false
function file_get_contents (string $filename, bool $use_include_path = false, $context, int $offset = 0, ?int $length): string|false
{}
/**

View File

@ -8,18 +8,18 @@ use JetBrains\PhpStorm\Pure;
* Runs the equivalent of the select() system call on the given
* arrays of streams with a timeout specified by tv_sec and tv_usec
* @link https://php.net/manual/en/function.stream-select.php
* @param array &$read <p>
* @param array|null &$read <p>
* The streams listed in the read array will be watched to
* see if characters become available for reading (more precisely, to see if
* a read will not block - in particular, a stream resource is also ready on
* end-of-file, in which case an fread will return
* a zero length string).
* </p>
* @param array &$write <p>
* @param array|null &$write <p>
* The streams listed in the write array will be
* watched to see if a write will not block.
* </p>
* @param array &$except <p>
* @param array|null &$except <p>
* The streams listed in the except array will be
* watched for high priority exceptional ("out-of-band") data arriving.
* </p>
@ -34,7 +34,7 @@ use JetBrains\PhpStorm\Pure;
* empty array or null instead. Also do not forget that those arrays are
* passed by reference and will be modified after
* stream_select returns.
* @param int $seconds <p>
* @param int|null $seconds <p>
* The tv_sec and tv_usec
* together form the timeout parameter,
* tv_sec specifies the number of seconds while
@ -77,7 +77,7 @@ use JetBrains\PhpStorm\Pure;
* is returned and a warning raised (this can happen if the system call is
* interrupted by an incoming signal).
*/
function stream_select (array &$read, array &$write, array &$except, int $seconds, int $microseconds): int|false
function stream_select (?array &$read, ?array &$write, ?array &$except, ?int $seconds, int $microseconds): int|false
{}
/**
@ -98,7 +98,7 @@ function stream_select (array &$read, array &$write, array &$except, int $second
* </p>
* @return resource A stream context resource.
*/
function stream_context_create (array $options, array $params) {}
function stream_context_create (?array $options, ?array $params) {}
/**
* Set parameters for a stream/wrapper/context
@ -177,7 +177,7 @@ function stream_context_get_options ($stream_or_context): array
* </p>
* @return resource A stream context resource.
*/
function stream_context_get_default (array $options) {}
function stream_context_get_default (?array $options) {}
/**
* Set the default stream context
@ -316,7 +316,7 @@ function stream_filter_remove ($stream_filter): bool
* fwrite, fclose, and
* feof), false on failure.
*/
function stream_socket_client (string $address, &$error_code, &$error_message, float $timeout, int $flags, $context)
function stream_socket_client (string $address, &$error_code, &$error_message, ?float $timeout, int $flags, $context)
{}
/**
@ -374,7 +374,7 @@ function stream_socket_server (string $address, &$error_code, &$error_message, i
* Accept a connection on a socket created by {@see stream_socket_server}
* @link https://php.net/manual/en/function.stream-socket-accept.php
* @param resource $socket
* @param float $timeout [optional] <p>
* @param float|null $timeout [optional] <p>
* Override the default socket accept timeout. Time should be given in
* seconds.
* </p>
@ -388,7 +388,7 @@ function stream_socket_server (string $address, &$error_code, &$error_message, i
* </p>
* @return resource|false Returns a stream to the accepted socket connection or FALSE on failure.
*/
function stream_socket_accept ($socket, float $timeout, &$peer_name)
function stream_socket_accept ($socket, ?float $timeout, &$peer_name)
{}
/**
@ -489,7 +489,7 @@ function stream_socket_sendto ($socket, string $data, int $flags, string $addres
* @param bool $enable <p>
* Enable/disable cryptography on the stream.
* </p>
* @param int $crypto_method [optional] <p>
* @param int|null $crypto_method [optional] <p>
* Setup encryption on the stream.
* Valid methods are
* STREAM_CRYPTO_METHOD_SSLv2_CLIENT
@ -500,7 +500,7 @@ function stream_socket_sendto ($socket, string $data, int $flags, string $addres
* 0 if there isn't enough data and you should try again
* (only for non-blocking sockets).
*/
function stream_socket_enable_crypto ($stream, bool $enable, int $crypto_method, $session_stream): int|bool
function stream_socket_enable_crypto ($stream, bool $enable, ?int $crypto_method, $session_stream): int|bool
{}
/**
@ -561,7 +561,7 @@ function stream_socket_pair (int $domain, int $type, int $protocol): array|false
* @param resource $to <p>
* The destination stream
* </p>
* @param int $length [optional] <p>
* @param int|null $length [optional] <p>
* Maximum bytes to copy
* </p>
* @param int $offset [optional] <p>
@ -569,7 +569,7 @@ function stream_socket_pair (int $domain, int $type, int $protocol): array|false
* </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): int|false
{}
/**
@ -578,7 +578,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 $length [optional] <p>
* @param int|null $length [optional] <p>
* The maximum bytes to read. Defaults to -1 (read all the remaining
* buffer).
* </p>
@ -587,7 +587,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 = -1, int $offset = -1): string|false
{}
/**
@ -609,7 +609,7 @@ function stream_supports_lock ($stream): bool
* fopen, popen, or
* fsockopen.
* </p>
* @param int $length [optional] <p>
* @param int|null $length [optional] <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
@ -638,7 +638,7 @@ function stream_supports_lock ($stream): bool
* handle is supplied or false on other errors,
* including end of file.
*/
function fgetcsv ($stream, int $length = 0, string $separator = ',', string $enclosure = '"', string $escape = '\\'): array|false
function fgetcsv ($stream, ?int $length = 0, string $separator = ',', string $enclosure = '"', string $escape = '\\'): array|false
{}
/**

View File

@ -31,7 +31,7 @@ use JetBrains\PhpStorm\Pure;
* @param string &$error_message [optional] <p>
* The error message as a string.
* </p>
* @param float $timeout [optional] <p>
* @param float|null $timeout [optional] <p>
* The connection timeout, in seconds.
* </p>
* <p>
@ -47,7 +47,7 @@ use JetBrains\PhpStorm\Pure;
* fwrite, fclose, and
* feof). If the call fails, it will return false
*/
function fsockopen (string $hostname, int $port, &$error_code, &$error_message, float $timeout)
function fsockopen (string $hostname, int $port, &$error_code, &$error_message, ?float $timeout)
{}
/**
@ -58,10 +58,10 @@ function fsockopen (string $hostname, int $port, &$error_code, &$error_message,
* @param int $port [optional]
* @param int &$error_code [optional]
* @param string &$error_message [optional]
* @param float $timeout [optional]
* @param float|null $timeout [optional]
* @return resource|false
*/
function pfsockopen (string $hostname, int $port, &$error_code, &$error_message, float $timeout)
function pfsockopen (string $hostname, int $port, &$error_code, &$error_message, ?float $timeout)
{}
/**
@ -193,7 +193,7 @@ function unpack (string $format, string $string, int $offset = 0): array|false
/**
* Tells what the user's browser is capable of
* @link https://php.net/manual/en/function.get-browser.php
* @param string $user_agent [optional] <p>
* @param string|null $user_agent [optional] <p>
* The User Agent to be analyzed. By default, the value of HTTP
* User-Agent header is used; however, you can alter this (i.e., look up
* another browser's info) by passing this parameter.
@ -218,10 +218,10 @@ function unpack (string $format, string $string, int $offset = 0): array|false
* reload, and check for the value.
*/
#[Pure]
function get_browser (string $user_agent, bool $return_array): object|array|false
function get_browser (?string $user_agent, bool $return_array): object|array|false
{}
#[PhpStormStubsElementAvailable(to: '7.4')]
/**
* One-way string encryption (hashing)
* @link https://php.net/manual/en/function.crypt.php
@ -241,6 +241,7 @@ function get_browser (string $user_agent, bool $return_array): object|array|fals
* @return string|null the encrypted string or <b>NULL</b> if an error occurs
*/
#[Pure]
#[PhpStormStubsElementAvailable(to: '7.4')]
function crypt ($string, $salt = null): ?string
{}
@ -261,10 +262,10 @@ function crypt ($string, $salt = null): ?string
* is generated once. If you are calling this function repeatedly, this
* may impact both appearance and security.
* </p>
* @return string|null the encrypted string or <b>NULL</b> if an error occurs
* @return string the encrypted string or <b>NULL</b> if an error occurs
*/
#[Pure]
function crypt (string $string, string $salt): ?string
function crypt (string $string, string $salt): string
{}
/**
@ -907,18 +908,18 @@ function chmod (string $filename, int $permissions): bool
* @param string $filename <p>
* The name of the file being touched.
* </p>
* @param int $mtime [optional] <p>
* @param int|null $mtime [optional] <p>
* The touch time. If time is not supplied,
* the current system time is used.
* </p>
* @param int $atime [optional] <p>
* @param int|null $atime [optional] <p>
* If present, the access time of the given filename is set to
* the value of atime. Otherwise, it is set to
* time.
* </p>
* @return bool true on success or false on failure.
*/
function touch (string $filename, int $mtime, int $atime): bool
function touch (string $filename, ?int $mtime, ?int $atime): bool
{}
/**

View File

@ -86,7 +86,7 @@ function header_register_callback ( callable $callback ): bool
* @since 5.4
* @link https://secure.php.net/manual/en/function.getimagesizefromstring.php
* @param string $string The image data, as a string.
* @param array &$image_info This optional parameter allows you to extract<br>
* @param array &$image_info [optional] This optional parameter allows you to extract<br>
* some extended information from the image file. Currently, this will <br>
* return the different JPG APP markers as an associative array. <br>
* Some programs use these APP markers to embed text information in images. <br>
@ -1025,7 +1025,7 @@ function array_unshift (array &$array, ...$values): int
* is negative then it starts that far from the end of the
* input array.
* </p>
* @param int $length [optional] <p>
* @param int|null $length [optional] <p>
* If length is omitted, removes everything
* from offset to the end of the array. If
* length is specified and is positive, then
@ -1056,7 +1056,7 @@ function array_unshift (array &$array, ...$values): int
* </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
{}
/**
@ -1071,7 +1071,7 @@ function array_splice (array &$array, int $offset, int $length, mixed $replaceme
* offset is negative, the sequence will
* start that far from the end of the array.
* </p>
* @param int $length [optional] <p>
* @param int|null $length [optional] <p>
* If length is given and is positive, then
* the sequence will have that many elements in it. If
* length is given and is negative then the
@ -1089,7 +1089,7 @@ function array_splice (array &$array, int $offset, int $length, mixed $replaceme
* @meta
*/
#[Pure]
function array_slice (array $array, int $offset, int $length, bool $preserve_keys = false): array
function array_slice (array $array, int $offset, ?int $length, bool $preserve_keys = false): array
{}
/**

View File

@ -55,10 +55,10 @@ function array_replace(array $array, array ...$replacements): array
* @param array ...$replacements <p>
* The array from which elements will be extracted.
* </p>
* @return array|null an array, or null if an error occurs.
* @return array an array, or null if an error occurs.
*/
#[Pure]
function array_replace_recursive(array $array, array ...$replacements): ?array
function array_replace_recursive(array $array, array ...$replacements): array
{ }
/**
@ -695,7 +695,7 @@ function array_product(array $array): int|float
* @param array $array <p>
* The array to iterate over
* </p>
* @param callback $callback [optional] <p>
* @param callback|null $callback [optional] <p>
* The callback function to use
* </p>
* <p>
@ -719,7 +719,7 @@ function array_product(array $array): int|float
* @return array the filtered array.
* @meta
*/
function array_filter(array $array, callable $callback, int $mode = 0): array { }
function array_filter(array $array, ?callable $callback, int $mode = 0): array { }
/**
* Applies the callback to the elements of the given arrays
@ -943,7 +943,7 @@ function assert_options(int $option, mixed $value): object|array|string|int|null
* @param string $version2 <p>
* Second version number.
* </p>
* @param string $operator [optional] <p>
* @param string|null $operator [optional] <p>
* If you specify the third optional operator
* argument, you can test for a particular relationship. The
* possible operators are: &lt;,
@ -968,7 +968,7 @@ function assert_options(int $option, mixed $value): object|array|string|int|null
* function will return true if the relationship is the one specified
* by the operator, false otherwise.
*/
function version_compare(string $version1, string $version2, string $operator): int|bool
function version_compare(string $version1, string $version2, ?string $operator): int|bool
{ }
/**
@ -1141,9 +1141,9 @@ function stream_filter_register(string $filter_name, string $class): bool
* Return a bucket object from the brigade for operating on
* @link https://php.net/manual/en/function.stream-bucket-make-writeable.php
* @param resource $brigade
* @return object
* @return object|null
*/
function stream_bucket_make_writeable($brigade): object
function stream_bucket_make_writeable($brigade): ?object
{ }
/**

View File

@ -9,7 +9,7 @@ use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware;
* @param int $key <p>
* A numeric shared memory segment ID
* </p>
* @param int $size [optional] <p>
* @param int|null $size [optional] <p>
* The memory size. If not provided, default to the
* sysvshm.init_mem in the <i>php.ini</i>, otherwise 10000
* bytes.
@ -20,7 +20,7 @@ use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware;
* @return resource|SysvSharedMemory|false a shared memory segment identifier.
*/
#[LanguageLevelTypeAware(["8.0" => "SysvSharedMemory|false"], default: "resource|false")]
function shm_attach (int $key, int $size, int $permissions = 0666) {}
function shm_attach (int $key, ?int $size, int $permissions = 0666) {}
/**
* Removes shared memory from Unix systems

9
test.php Normal file
View File

@ -0,0 +1,9 @@
<?php
declare(strict_types=1);
$descriptorspec = array(
0 => array('pipe', 'r'), // stdin is a pipe that the child will read from
1 => array('pipe', 'w'), // stdout is a pipe that the child will write to
2 => array('file', '/tmp/error-output.txt', 'a') // stderr is a file to write to
);
proc_open("ls", $descriptorspec, $pipes, null);
var_dump((new ReflectionFunction("proc_open"))->getParameters()[3]->getType()->allowsNull());

View File

@ -48,12 +48,12 @@ abstract class BasePHPElement
protected static function convertReflectionTypeToString(?ReflectionType $type): string
{
if ($type instanceof ReflectionNamedType) {
return $type->getName();
return (string)$type;
}
if ($type instanceof ReflectionUnionType) {
$reflectionType = '';
foreach ($type->getTypes() as $type) {
$reflectionType .= $type->getName() . '|';
$reflectionType .= (string)$type . '|';
}
return substr($reflectionType, 0, -1);
}
@ -78,15 +78,17 @@ abstract class BasePHPElement
protected static function getTypeNameFromNode(Name|Identifier|NullableType|string $type): string
{
$nullable = false;
if($type instanceof NullableType){
$type = $type->type;
$nullable = true;
}
if (empty($type->name)) {
if (!empty($type->parts)) {
return $type->parts[0];
return $nullable ? '?' . $type->parts[0] : $type->parts[0];
}
} else {
return $type->name;
return $nullable ? '?' . $type->name : $type->name;
}
}

View File

@ -116,12 +116,10 @@ class StubsTest extends TestCase
fn(PHPParameter $stubParameter) => $stubParameter->name === $parameter->name),
"Function ${functionName} has signature $functionName(" . $this->printParameters($function->parameters) . ')' .
" but stub function has signature $functionName(" . $this->printParameters($phpstormFunction->parameters) . ")");
self::assertEquals($parameter->type, current(array_filter($phpstormFunction->parameters,
fn(PHPParameter $stubParameter) => $stubParameter->name === $parameter->name))->type, "Type mismatch $functionName: \$$parameter->name ");
self::assertEquals($parameter->is_passed_by_ref, current(array_filter($phpstormFunction->parameters,
fn(PHPParameter $stubParameter) => $stubParameter->name === $parameter->name))->is_passed_by_ref, "Invalid pass by ref $functionName: \$$parameter->name ");
self::assertEquals($parameter->is_vararg, current(array_filter($phpstormFunction->parameters,
fn(PHPParameter $stubParameter) => $stubParameter->name === $parameter->name))->is_vararg, "Invalid pass by ref $functionName: \$$parameter->name ");
$stubParameter = current(array_filter($phpstormFunction->parameters, fn(PHPParameter $stubParameter) => $stubParameter->name === $parameter->name));
self::assertEquals($parameter->type, $stubParameter->type, "Type mismatch $functionName: \$$parameter->name ");
self::assertEquals($parameter->is_passed_by_ref, $stubParameter->is_passed_by_ref, "Invalid pass by ref $functionName: \$$parameter->name ");
self::assertEquals($parameter->is_vararg, $stubParameter->is_vararg, "Invalid pass by ref $functionName: \$$parameter->name ");
}
}
}

View File

@ -7,7 +7,7 @@ use JetBrains\PhpStorm\Pure;
/**
* Create an XML parser
* @link https://php.net/manual/en/function.xml-parser-create.php
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* The optional <i>encoding</i> specifies the character
* encoding for the input/output in PHP 4. Starting from PHP 5, the input
* encoding is automatically detected, so that the
@ -24,12 +24,12 @@ use JetBrains\PhpStorm\Pure;
*/
#[Pure]
#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")]
function xml_parser_create (string $encoding) {}
function xml_parser_create (?string $encoding) {}
/**
* Create an XML parser with namespace support
* @link https://php.net/manual/en/function.xml-parser-create-ns.php
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* The optional <i>encoding</i> specifies the character
* encoding for the input/output in PHP 4. Starting from PHP 5, the input
* encoding is automatically detected, so that the
@ -49,7 +49,7 @@ function xml_parser_create (string $encoding) {}
*/
#[Pure]
#[LanguageLevelTypeAware(["8.0" => "XmlParser"], default: "resource")]
function xml_parser_create_ns (string $encoding, string $separator = ':') {}
function xml_parser_create_ns (?string $encoding, string $separator = ':') {}
/**
* Use XML Parser within an object
@ -390,11 +390,11 @@ function xml_get_error_code (#[LanguageLevelTypeAware(["8.0" => "XmlParser"], de
* @param int $error_code <p>
* An error code from <b>xml_get_error_code</b>.
* </p>
* @return string a string with a textual description of the error
* @return string|null a string with a textual description of the error
* <i>code</i>, or <b>FALSE</b> if no description was found.
*/
#[Pure]
function xml_error_string (int $error_code): string
function xml_error_string (int $error_code): ?string
{}
/**

View File

@ -108,7 +108,7 @@ class XMLWriter {
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
* Create start namespaced attribute
* @link https://php.net/manual/en/function.xmlwriter-start-attribute-ns.php
* @param string $prefix <p>
* @param string|null $prefix <p>
* The namespace prefix.
* </p>
* @param string $name <p>
@ -125,7 +125,7 @@ class XMLWriter {
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
* Write full namespaced attribute
* @link https://php.net/manual/en/function.xmlwriter-write-attribute-ns.php
* @param string $prefix <p>
* @param string|null $prefix <p>
* The namespace prefix.
* </p>
* @param string $name <p>
@ -172,7 +172,7 @@ class XMLWriter {
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
* Create start namespaced element tag
* @link https://php.net/manual/en/function.xmlwriter-start-element-ns.php
* @param string $prefix <p>
* @param string|null $prefix <p>
* The namespace prefix.
* </p>
* @param string $name <p>
@ -203,7 +203,7 @@ class XMLWriter {
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>
* Write full namespaced element tag
* @link https://php.net/manual/en/function.xmlwriter-write-element-ns.php
* @param string $prefix <p>
* @param string|null $prefix <p>
* The namespace prefix.
* </p>
* @param string $name <p>
@ -663,18 +663,18 @@ function xmlwriter_write_attribute (#[LanguageLevelTypeAware(["8.0" => "XMLWrite
* The XMLWriter {@link https://php.net/manual/en/language.types.resource.php" resource} that is being modified.
* This resource comes from a call to {@link https://php.net/manual/en/function.xmlwriter-open-uri.php" xmlwriter_open_uri()}
* or {@link https://php.net/manual/en/function.xmlwriter-open-memory.php" xmlwriter_open_memory()}.</p>
* @param string $prefix <p>
* @param string|null $prefix <p>
* The namespace prefix.
* </p>
* @param string $name <p>
* The attribute name.
* </p>
* @param string $namespace <p>
* @param string|null $namespace <p>
* The namespace URI.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_start_attribute_ns (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $prefix, string $name, string $namespace): bool
function xmlwriter_start_attribute_ns (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, ?string $prefix, string $name, ?string $namespace): bool
{}
/**
@ -686,13 +686,13 @@ function xmlwriter_start_attribute_ns (#[LanguageLevelTypeAware(["8.0" => "XMLWr
* The XMLWriter {@link https://php.net/manual/en/language.types.resource.php" resource} that is being modified.
* This resource comes from a call to {@link https://php.net/manual/en/function.xmlwriter-open-uri.php" xmlwriter_open_uri()}
* or {@link https://php.net/manual/en/function.xmlwriter-open-memory.php" xmlwriter_open_memory()}.</p>
* @param string $prefix <p>
* @param string|null $prefix <p>
* The namespace prefix.
* </p>
* @param string $name <p>
* The attribute name.
* </p>
* @param string $namespace <p>
* @param string|null $namespace <p>
* The namespace URI.
* </p>
* @param string $value <p>
@ -700,7 +700,7 @@ function xmlwriter_start_attribute_ns (#[LanguageLevelTypeAware(["8.0" => "XMLWr
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_write_attribute_ns (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $prefix, string $name, string $namespace, string $value): bool
function xmlwriter_write_attribute_ns (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, ?string $prefix, string $name, ?string $namespace, string $value): bool
{}
/**
@ -755,18 +755,18 @@ function xmlwriter_full_end_element (#[LanguageLevelTypeAware(["8.0" => "XMLWrit
* The XMLWriter {@link https://php.net/manual/en/language.types.resource.php" resource} that is being modified.
* This resource comes from a call to {@link https://php.net/manual/en/function.xmlwriter-open-uri.php" xmlwriter_open_uri()}
* or {@link https://php.net/manual/en/function.xmlwriter-open-memory.php" xmlwriter_open_memory()}.</p>
* @param string $prefix <p>
* @param string|null $prefix <p>
* The namespace prefix.
* </p>
* @param string $name <p>
* The element name.
* </p>
* @param string $namespace <p>
* @param string|null $namespace <p>
* The namespace URI.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_start_element_ns (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $prefix, string $name, string $namespace): bool
function xmlwriter_start_element_ns (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, ?string $prefix, string $name, ?string $namespace): bool
{}
/**
@ -781,12 +781,12 @@ function xmlwriter_start_element_ns (#[LanguageLevelTypeAware(["8.0" => "XMLWrit
* @param string $name <p>
* The element name.
* </p>
* @param string $content [optional] <p>
* @param string|null $content [optional] <p>
* The element contents.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_write_element (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $name, string $content): bool
function xmlwriter_write_element (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $name, ?string $content): bool
{}
/**
@ -798,21 +798,21 @@ function xmlwriter_write_element (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"
* The XMLWriter {@link https://php.net/manual/en/language.types.resource.php" resource} that is being modified.
* This resource comes from a call to {@link https://php.net/manual/en/function.xmlwriter-open-uri.php" xmlwriter_open_uri()}
* or {@link https://php.net/manual/en/function.xmlwriter-open-memory.php" xmlwriter_open_memory()}.</p>
* @param string $prefix <p>
* @param string|null $prefix <p>
* The namespace prefix.
* </p>
* @param string $name <p>
* The element name.
* </p>
* @param string $namespace <p>
* @param string|null $namespace <p>
* The namespace URI.
* </p>
* @param string $content [optional] <p>
* @param string|null $content [optional] <p>
* The element contents.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_write_element_ns (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $prefix, string $name, string $namespace, string $content): bool
function xmlwriter_write_element_ns (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, ?string $prefix, string $name, ?string $namespace, ?string $content): bool
{}
/**
@ -954,18 +954,18 @@ function xmlwriter_write_raw (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], d
* The XMLWriter {@link https://php.net/manual/en/language.types.resource.php" resource} that is being modified.
* This resource comes from a call to {@link https://php.net/manual/en/function.xmlwriter-open-uri.php" xmlwriter_open_uri()}
* or {@link https://php.net/manual/en/function.xmlwriter-open-memory.php" xmlwriter_open_memory()}.</p>
* @param string $version [optional] <p>
* @param string|null $version [optional] <p>
* The version number of the document as part of the XML declaration.
* </p>
* @param string $encoding [optional] <p>
* @param string|null $encoding [optional] <p>
* The encoding of the document as part of the XML declaration.
* </p>
* @param string $standalone [optional] <p>
* @param string|null $standalone [optional] <p>
* yes or no.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_start_document (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $version = '1.0', string $encoding, string $standalone): bool
function xmlwriter_start_document (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, ?string $version = '1.0', ?string $encoding, ?string $standalone): bool
{}
/**
@ -1011,15 +1011,15 @@ function xmlwriter_write_comment (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"
* @param string $qualifiedName <p>
* The qualified name of the document type to create.
* </p>
* @param string $publicId [optional] <p>
* @param string|null $publicId [optional] <p>
* The external subset public identifier.
* </p>
* @param string $systemId [optional] <p>
* @param string|null $systemId [optional] <p>
* The external subset system identifier.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_start_dtd (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $qualifiedName, string $publicId, string $systemId): bool
function xmlwriter_start_dtd (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $qualifiedName, ?string $publicId, ?string $systemId): bool
{}
/**
@ -1047,18 +1047,18 @@ function xmlwriter_end_dtd (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], def
* @param string $name <p>
* The DTD name.
* </p>
* @param string $publicId [optional] <p>
* @param string|null $publicId [optional] <p>
* The external subset public identifier.
* </p>
* @param string $systemId [optional] <p>
* @param string|null $systemId [optional] <p>
* The external subset system identifier.
* </p>
* @param string $content [optional] <p>
* @param string|null $content [optional] <p>
* The content of the DTD.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xmlwriter_write_dtd (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $name, string $publicId, string $systemId, string $content): bool
function xmlwriter_write_dtd (#[LanguageLevelTypeAware(["8.0" => "XMLWriter"], default: "resource")] $writer, string $name, ?string $publicId, ?string $systemId, ?string $content): bool
{}
/**

View File

@ -204,7 +204,7 @@ function gztell ($stream): int|false {}
* @param string $data <p>
* The string to write.
* </p>
* @param int $length [optional] <p>
* @param int|null $length [optional] <p>
* The number of uncompressed bytes to write. If supplied, writing will
* stop after <i>length</i> (uncompressed) bytes have been
* written or the end of <i>string</i> is reached,
@ -219,7 +219,7 @@ function gztell ($stream): int|false {}
* @return int|false the number of (uncompressed) bytes written to the given gz-file
* stream.
*/
function gzwrite ($stream, string $data, int $length): int|false
function gzwrite ($stream, string $data, ?int $length): int|false
{}
/**
@ -227,9 +227,9 @@ function gzwrite ($stream, string $data, int $length): int|false
* @link https://php.net/manual/en/function.gzputs.php
* @param resource $stream
* @param string $data
* @param int $length [optional]
* @param int|null $length [optional]
*/
function gzputs ($stream, string $data, int $length): int|false {}
function gzputs ($stream, string $data, ?int $length): int|false {}
/**
* Read entire gz-file into an array