Provide PHP 8 types to function signatures

This commit is contained in:
Maxim.Kolmakov 2020-11-17 18:10:56 +01:00
parent 5cd47660c0
commit 4c2a5f87b8
57 changed files with 1297 additions and 1128 deletions

View File

@ -32,7 +32,7 @@ function func_num_args () {}
* @return mixed|false the specified argument, or false on error.
*/
#[Pure]
function func_get_arg ($position) {}
function func_get_arg (int $position) {}
/**
* Returns an array comprising a function's argument list
@ -53,7 +53,7 @@ function func_get_args () {}
* and 0 if the <i>string</i> is empty.
*/
#[Pure]
function strlen ($string) {}
function strlen (string $string) {}
/**
* Binary safe string comparison
@ -70,7 +70,7 @@ function strlen ($string) {}
* equal.
*/
#[Pure]
function strcmp ($string1, $string2) {}
function strcmp (string $string1, string $string2) {}
/**
* Binary safe string comparison of the first n characters
@ -90,7 +90,7 @@ function strcmp ($string1, $string2) {}
* equal.
*/
#[Pure]
function strncmp ($string1, $string2, $length) {}
function strncmp (string $string1, string $string2, int $length) {}
/**
* Binary safe case-insensitive string comparison
@ -107,7 +107,7 @@ function strncmp ($string1, $string2, $length) {}
* equal.
*/
#[Pure]
function strcasecmp ($string1, $string2) {}
function strcasecmp (string $string1, string $string2) {}
/**
* Binary safe case-insensitive string comparison of the first n characters
@ -126,7 +126,7 @@ function strcasecmp ($string1, $string2) {}
* greater than <i>str2</i>, and 0 if they are equal.
*/
#[Pure]
function strncasecmp ($string1, $string2, $length) {}
function strncasecmp (string $string1, string $string2, int $length) {}
/**
* The function returns {@see true} if the passed $haystack starts from the
@ -309,7 +309,7 @@ function each (array &$array) {}
* level or the current level if no <i>level</i> parameter is
* given.
*/
function error_reporting ($error_level = null) {}
function error_reporting (int $error_level) {}
/**
* Defines a named constant
@ -336,7 +336,7 @@ function error_reporting ($error_level = null) {}
* </p>
* @return bool true on success or false on failure.
*/
function define ($constant_name, $value, #[Deprecated] $case_insensitive = false) {}
function define (string $constant_name, $value, #[Deprecated] bool $case_insensitive = false) {}
/**
* Checks whether a given named constant exists
@ -348,7 +348,7 @@ function define ($constant_name, $value, #[Deprecated] $case_insensitive = false
* has been defined, false otherwise.
*/
#[Pure]
function defined ($constant_name) {}
function defined (string $constant_name) {}
/**
* Returns the name of the class of an object
@ -365,7 +365,7 @@ function defined ($constant_name) {}
* name of that class is returned.
*/
#[Pure]
function get_class ($object = null) {}
function get_class (object $object) {}
/**
* the "Late Static Binding" class name
@ -391,7 +391,7 @@ function get_called_class () {}
* If called without parameter outside object, this function returns false.
*/
#[Pure]
function get_parent_class ($object_or_class = null) {}
function get_parent_class (object|string $object_or_class) {}
/**
* Checks if the class method exists
@ -407,7 +407,7 @@ function get_parent_class ($object_or_class = null) {}
* otherwise.
*/
#[Pure]
function method_exists ($object_or_class, $method) {}
function method_exists (mixed $object_or_class, string $method) {}
/**
* Checks if the object or class has a property
@ -422,7 +422,7 @@ function method_exists ($object_or_class, $method) {}
* null in case of an error.
*/
#[Pure]
function property_exists ($object_or_class, $property) {}
function property_exists (mixed $object_or_class, string $property) {}
/**
* Checks if the trait exists
@ -432,7 +432,7 @@ function property_exists ($object_or_class, $property) {}
* @link https://secure.php.net/manual/en/function.trait-exists.php
* @since 5.4
*/
function trait_exists($trait, $autoload ) {}
function trait_exists(string $trait, bool $autoload) {}
/**
* Checks if the class has been defined
@ -446,7 +446,7 @@ function trait_exists($trait, $autoload ) {}
* @return bool true if <i>class_name</i> is a defined class,
* false otherwise.
*/
function class_exists ($class, $autoload = true) {}
function class_exists (string $class, bool $autoload = true) {}
/**
* Checks if the interface has been defined
@ -461,7 +461,7 @@ function class_exists ($class, $autoload = true) {}
* <i>interface_name</i> has been defined, false otherwise.
* @since 5.0.2
*/
function interface_exists ($interface, $autoload = true) {}
function interface_exists (string $interface, bool $autoload = true) {}
/**
* Return true if the given function has been defined
@ -477,7 +477,7 @@ function interface_exists ($interface, $autoload = true) {}
* <b>include_once</b> and <b>echo</b>.
*/
#[Pure]
function function_exists ($function) {}
function function_exists (string $function) {}
/**
* Creates an alias for a class
@ -487,7 +487,7 @@ function function_exists ($function) {}
* @param bool $autoload [optional] Whether to autoload if the original class is not found.
* @return bool true on success or false on failure.
*/
function class_alias ($class, $alias, $autoload = true) {}
function class_alias (string $class, string $alias, bool $autoload = true) {}
/**
* Returns an array with the names of included or required files
@ -532,7 +532,7 @@ function get_required_files () {}
* <i>class_name</i>, false otherwise.
*/
#[Pure]
function is_subclass_of ($object_or_class, $class, $allow_string = true) {}
function is_subclass_of (mixed $object_or_class, string $class, bool $allow_string = true) {}
/**
* Checks if the object is of this class or has this class as one of its parents
@ -551,7 +551,7 @@ function is_subclass_of ($object_or_class, $class, $allow_string = true) {}
* its parents, <b>FALSE</b> otherwise.
*/
#[Pure]
function is_a ($object_or_class, $class, $allow_string = false) {}
function is_a (mixed $object_or_class, string $class, bool $allow_string = false) {}
/**
* Get the default properties of the class
@ -565,7 +565,7 @@ function is_a ($object_or_class, $class, $allow_string = false) {}
* varname => value.
*/
#[Pure]
function get_class_vars ($class) {}
function get_class_vars (string $class) {}
/**
* Gets the properties of the given object
@ -578,7 +578,7 @@ function get_class_vars ($class) {}
* not been assigned a value, it will be returned with a null value.
*/
#[Pure]
function get_object_vars ($object) {}
function get_object_vars (object $object) {}
/**
* Gets the class methods' names
@ -590,7 +590,7 @@ function get_object_vars ($object) {}
* <i>class_name</i>. In case of an error, it returns null.
*/
#[Pure]
function get_class_methods ($object_or_class) {}
function get_class_methods (object|string $object_or_class) {}
/**
* Generates a user-level error/warning/notice message
@ -607,22 +607,22 @@ function get_class_methods ($object_or_class) {}
* @return bool This function returns false if wrong <i>error_type</i> is
* specified, true otherwise.
*/
function trigger_error ($message, $error_level = E_USER_NOTICE) {}
function trigger_error (string $message, int $error_level = E_USER_NOTICE) {}
/**
* Alias of <b>trigger_error</b>
* @link https://php.net/manual/en/function.user-error.php
* @param string $message
* @param int $error_level [optional]
* @param int $error_level [optional]
* @return bool This function returns false if wrong <i>error_type</i> is
* specified, true otherwise.
*/
function user_error ($message, $error_level = E_USER_NOTICE) {}
function user_error (string $message, int $error_level = E_USER_NOTICE) {}
/**
* Sets a user-defined error handler function
* @link https://php.net/manual/en/function.set-error-handler.php
* @param callable|null $callback <p>
* @param callable $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
@ -640,7 +640,7 @@ function user_error ($message, $error_level = E_USER_NOTICE) {}
* <i>errno</i>
* The first parameter, <i>errno</i>, contains the
* level of the error raised, as an integer.
* @param int $error_levels [optional] <p>
* @param int|string $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
@ -653,7 +653,8 @@ function user_error ($message, $error_level = E_USER_NOTICE) {}
* was a class method, this function will return an indexed array with the class
* and the method name.
*/
function set_error_handler ($callback, $error_levels = E_ALL | E_STRICT) {}
function set_error_handler (callable $callback, int $error_levels = E_ALL | E_STRICT)
{}
/**
* Restores the previous error handler function
@ -665,7 +666,7 @@ function restore_error_handler () {}
/**
* Sets a user-defined exception handler function
* @link https://php.net/manual/en/function.set-exception-handler.php
* @param callable|null $callback <p>
* @param callable $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
@ -676,7 +677,7 @@ function restore_error_handler () {}
* @return callable|null 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 ($callback) {}
function set_exception_handler (callable $callback) {}
/**
* Restores the previously defined exception handler function
@ -730,7 +731,7 @@ function get_declared_traits() {}
* below).
*/
#[Pure]
function get_defined_functions ($exclude_disabled = false) {}
function get_defined_functions (bool $exclude_disabled = false) {}
/**
* Returns an array of all defined variables
@ -753,7 +754,7 @@ function get_defined_vars () {}
* @removed 8.0
*/
#[Deprecated(reason: "Use anonymous functions instead", since: "7.2")]
function create_function ($args, $code) {}
function create_function (string $args, string $code) {}
/**
* Returns the resource type
@ -778,7 +779,7 @@ function get_resource_type ($resource) {}
* @return string[] an indexed array of all the modules names.
*/
#[Pure]
function get_loaded_extensions ($zend_extensions = false) {}
function get_loaded_extensions (bool $zend_extensions = false) {}
/**
* Find out whether an extension is loaded
@ -813,7 +814,7 @@ function get_loaded_extensions ($zend_extensions = false) {}
* is loaded, false otherwise.
*/
#[Pure]
function extension_loaded ($extension) {}
function extension_loaded (string $extension) {}
/**
* Returns an array with the names of the functions of a module
@ -828,7 +829,7 @@ function extension_loaded ($extension) {}
* <i>module_name</i> is not a valid extension.
*/
#[Pure]
function get_extension_funcs ($extension) {}
function get_extension_funcs (string $extension) {}
/**
* Returns an associative array with the names of all the constants and their values
@ -885,7 +886,7 @@ function get_extension_funcs ($extension) {}
* @return array
*/
#[Pure]
function get_defined_constants ($categorize = false) {}
function get_defined_constants (bool $categorize = false) {}
/**
* Generates a backtrace
@ -983,7 +984,7 @@ function get_defined_constants ($categorize = false) {}
* </tr>
* </table>
*/
function debug_backtrace ($options = DEBUG_BACKTRACE_PROVIDE_OBJECT, $limit = 0) {}
function debug_backtrace (int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT, int $limit = 0) {}
/**
* Prints a backtrace
@ -1007,7 +1008,7 @@ function debug_backtrace ($options = DEBUG_BACKTRACE_PROVIDE_OBJECT, $limit = 0)
* </p>
* @return void
*/
function debug_print_backtrace ($options = 0, $limit = 0) {}
function debug_print_backtrace (int $options = 0, int $limit = 0) {}
/**
* Forces collection of any existing garbage cycles
@ -1077,4 +1078,4 @@ function gc_mem_caches () {}
* @since 7.0
*/
#[Pure]
function get_resources ($type = null) {}
function get_resources (string $type) {}

View File

@ -25,7 +25,8 @@ function spl_classes () {}
* @return void
* @since 5.1.2
*/
function spl_autoload ($class, $file_extensions = null) {}
function spl_autoload (string $class, string $file_extensions)
{}
/**
* Register and return default file extensions for spl_autoload
@ -41,7 +42,7 @@ function spl_autoload ($class, $file_extensions = null) {}
* spl_autoload.
* @since 5.1.2
*/
function spl_autoload_extensions ($file_extensions = null) {}
function spl_autoload_extensions (string $file_extensions) {}
/**
* Register given function as __autoload() implementation
@ -59,18 +60,18 @@ function spl_autoload_extensions ($file_extensions = null) {}
* @throws TypeError Since 8.0.
* @since 5.1.2
*/
function spl_autoload_register ($callback = null, $throw = true, $prepend = false) {}
function spl_autoload_register (callable $callback, bool $throw = true, bool $prepend = false) {}
/**
* Unregister given function as __autoload() implementation
* @link https://php.net/manual/en/function.spl-autoload-unregister.php
* @param mixed $callback <p>
* @param callable $callback <p>
* The autoload function being unregistered.
* </p>
* @return bool true on success or false on failure.
* @since 5.1.2
*/
function spl_autoload_unregister ($callback) {}
function spl_autoload_unregister (callable $callback) {}
/**
* Return all registered __autoload() functions
@ -91,7 +92,7 @@ function spl_autoload_functions () {}
* @return void
* @since 5.1.2
*/
function spl_autoload_call ($class) {}
function spl_autoload_call (string $class) {}
/**
* Return the parent classes of the given class
@ -107,7 +108,8 @@ function spl_autoload_call ($class) {}
* @return string[]|false An array on success, or false on error.
*/
#[Pure]
function class_parents ($object_or_class, $autoload = null) {}
function class_parents ($object_or_class, bool $autoload)
{}
/**
* Return the interfaces which are implemented by the given class
@ -123,7 +125,8 @@ function class_parents ($object_or_class, $autoload = null) {}
* @return string[]|false An array on success, or false on error.
*/
#[Pure]
function class_implements ($object_or_class, $autoload = null) {}
function class_implements ($object_or_class, bool $autoload)
{}
/**
* Return hash id for given object
@ -133,7 +136,7 @@ function class_implements ($object_or_class, $autoload = null) {}
* the same object.
*/
#[Pure]
function spl_object_hash ($object) {}
function spl_object_hash (object $object) {}
/**
* Copy the iterator into an array
@ -147,7 +150,7 @@ function spl_object_hash ($object) {}
* @return array An array containing the elements of the iterator.
*/
#[Pure]
function iterator_to_array (Traversable $iterator, $preserve_keys = true) {}
function iterator_to_array (Traversable $iterator, bool $preserve_keys = true) {}
/**
* Count the elements in an iterator
@ -176,7 +179,8 @@ function iterator_count (Traversable $iterator) {}
* </p>
* @return int the iteration count.
*/
function iterator_apply (Traversable $iterator, $callback, array $args = null) {}
function iterator_apply (Traversable $iterator, callable $callback, array $args)
{}
// End of SPL v.0.2
@ -190,7 +194,7 @@ function iterator_apply (Traversable $iterator, $callback, array $args = null) {
* @see get_declared_traits()
* @since 5.4
*/
function class_uses($object_or_class, bool $autoload = true ) {}
function class_uses($object_or_class, bool $autoload = true) {}
/**
* return the integer object handle for given object
@ -198,6 +202,6 @@ function class_uses($object_or_class, bool $autoload = true ) {}
* @return int
* @since 7.2
*/
function spl_object_id($object) {}
function spl_object_id(object $object) {}
?>

View File

@ -418,7 +418,7 @@ class SimpleXMLIterator extends SimpleXMLElement implements RecursiveIterator, C
* @return SimpleXMLElement 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 ($filename, $class_name = "SimpleXMLElement", $options = 0, $namespace_or_prefix = "", $is_prefix = false) {}
function simplexml_load_file (string $filename, string $class_name = "SimpleXMLElement", int $options = 0, string $namespace_or_prefix = "", bool $is_prefix = false) {}
/**
* Interprets a string of XML into an object
@ -446,7 +446,7 @@ function simplexml_load_file ($filename, $class_name = "SimpleXMLElement", $opti
* @return SimpleXMLElement 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 ($data, $class_name = "SimpleXMLElement", $options = 0, $namespace_or_prefix = "", $is_prefix = false) {}
function simplexml_load_string (string $data, string $class_name = "SimpleXMLElement", int $options = 0, string $namespace_or_prefix = "", bool $is_prefix = false) {}
/**
* Get a SimpleXMLElement object from a DOM node.
@ -462,6 +462,6 @@ function simplexml_load_string ($data, $class_name = "SimpleXMLElement", $option
* </p>
* @return SimpleXMLElement a SimpleXMLElement or <b>FALSE</b> on failure.
*/
function simplexml_import_dom (DOMNode $node, $class_name = "SimpleXMLElement") {}
function simplexml_import_dom (DOMNode $node, string $class_name = "SimpleXMLElement") {}
// End of SimpleXML v.0.1

View File

@ -11,7 +11,7 @@
* cache is disabled.
* @since 5.5
*/
function opcache_compile_file($filename) { }
function opcache_compile_file(string $filename) { }
/**
* (PHP 5 &gt;= 5.5.0, PECL ZendOpcache &gt;= 7.0.0 )<br/>
@ -25,7 +25,7 @@ function opcache_compile_file($filename) { }
* cache is disabled.
* @since 5.5
*/
function opcache_invalidate($filename, $force = false) { }
function opcache_invalidate(string $filename, bool $force = false) { }
/**
* (PHP 5 &gt;= 5.5.0, PECL ZendOpcache &gt;= 7.0.0 )<br/>
@ -44,7 +44,7 @@ function opcache_reset() { }
* @return array <p>Returns an array of information, optionally containing script specific state information</p>
* @since 5.5
*/
function opcache_get_status ($include_scripts = true) {}
function opcache_get_status (bool $include_scripts = true) {}
/**
* (PHP 5 &gt;= 5.5.5, PECL ZendOpcache &gt;= 7.0.2 )<br/>
@ -64,4 +64,4 @@ function opcache_get_configuration() {}
* @return bool Returns TRUE if file is cached in OPCache, FALSE otherwise.
* @since 5.6
*/
function opcache_is_script_cached($filename) {}
function opcache_is_script_cached(string $filename) {}

View File

@ -20,7 +20,7 @@ use JetBrains\PhpStorm\Pure;
* @return string The sum of the two operands, as a string.
*/
#[Pure]
function bcadd ($num1, $num2, $scale = 0) {}
function bcadd (string $num1, string $num2, int $scale = 0) {}
/**
* Subtract one arbitrary precision number from another
@ -40,7 +40,7 @@ function bcadd ($num1, $num2, $scale = 0) {}
* @return string The result of the subtraction, as a string.
*/
#[Pure]
function bcsub ($num1, $num2, $scale = 0) {}
function bcsub (string $num1, string $num2, int $scale = 0) {}
/**
* Multiply two arbitrary precision numbers
@ -60,7 +60,7 @@ function bcsub ($num1, $num2, $scale = 0) {}
* @return string the result as a string.
*/
#[Pure]
function bcmul ($num1, $num2, $scale = 0) {}
function bcmul (string $num1, string $num2, int $scale = 0) {}
/**
* Divide two arbitrary precision numbers
@ -81,7 +81,7 @@ function bcmul ($num1, $num2, $scale = 0) {}
* <i>divisor</i> is 0.
*/
#[Pure]
function bcdiv ($num1, $num2, $scale = 0) {}
function bcdiv (string $num1, string $num2, int $scale = 0) {}
/**
* Get modulus of an arbitrary precision number
@ -102,7 +102,7 @@ function bcdiv ($num1, $num2, $scale = 0) {}
* <i>divisor</i> is 0.
*/
#[Pure]
function bcmod ($num1, $num2, $scale = 0) {}
function bcmod (string $num1, string $num2, int $scale = 0) {}
/**
* Raise an arbitrary precision number to another
@ -124,7 +124,7 @@ function bcmod ($num1, $num2, $scale = 0) {}
* @return string the result as a string.
*/
#[Pure]
function bcpow ($num, $exponent, $scale = 0) {}
function bcpow (string $num, string $exponent, int $scale = 0) {}
/**
* Get the square root of an arbitrary precision number
@ -137,7 +137,7 @@ function bcpow ($num, $exponent, $scale = 0) {}
* <i>operand</i> is negative.
*/
#[Pure]
function bcsqrt ($num, $scale = null) {}
function bcsqrt (string $num, int $scale) {}
/**
* Set default scale parameter for all bc math functions
@ -147,7 +147,7 @@ function bcsqrt ($num, $scale = null) {}
* </p>
* @return int|true <b>INT</b> since 7.3.0 and <b>TRUE</b> before.
*/
function bcscale ($scale = null) {}
function bcscale (int $scale) {}
/**
* Compare two arbitrary precision numbers
@ -168,7 +168,7 @@ function bcscale ($scale = null) {}
* <i>right_operand</i>, -1 otherwise.
*/
#[Pure]
function bccomp ($num1, $num2, $scale = 0) {}
function bccomp (string $num1, string $num2, int $scale = 0) {}
/**
* Raise an arbitrary precision number to another, reduced by a specified modulus
@ -193,4 +193,4 @@ function bccomp ($num1, $num2, $scale = 0) {}
* is 0 or <i>exponent</i> is negative.
*/
#[Pure]
function bcpowmod ($num, $exponent, $modulus, $scale = 0) {}
function bcpowmod (string $num, string $exponent, string $modulus, int $scale = 0) {}

View File

@ -17,7 +17,7 @@ use JetBrains\PhpStorm\Pure;
* it returns a pointer to the newly opened file.
*/
#[Pure]
function bzopen ($file, $mode) {}
function bzopen ($file, string $mode) {}
/**
* Binary safe bzip2 file read
@ -33,7 +33,7 @@ function bzopen ($file, $mode) {}
* </p>
* @return string the uncompressed data, or <b>FALSE</b> on error.
*/
function bzread ($bz, $length = 1024) {}
function bzread ($bz, int $length = 1024) {}
/**
* Binary safe bzip2 file write
@ -52,7 +52,8 @@ function bzread ($bz, $length = 1024) {}
* </p>
* @return int the number of bytes written, or <b>FALSE</b> on error.
*/
function bzwrite ($bz, $data, $length = null) {}
function bzwrite ($bz, string $data, int $length)
{}
/**
* Force a write of all buffered data
@ -137,7 +138,7 @@ function bzerror ($bz) {}
* @return mixed The compressed string, or an error number if an error occurred.
*/
#[Pure]
function bzcompress ($data, $block_size = 4, $work_factor = 0) {}
function bzcompress (string $data, int $block_size = 4, int $work_factor = 0) {}
/**
* Decompresses bzip2 encoded data
@ -145,7 +146,7 @@ function bzcompress ($data, $block_size = 4, $work_factor = 0) {}
* @param string $data <p>
* The string to decompress.
* </p>
* @param int $use_less_memory [optional] <p>
* @param bool $use_less_memory [optional] <p>
* If <b>TRUE</b>, an alternative decompression algorithm will be used which
* uses less memory (the maximum memory requirement drops to around 2300K)
* but works at roughly half the speed.
@ -157,4 +158,4 @@ function bzcompress ($data, $block_size = 4, $work_factor = 0) {}
* @return mixed The decompressed string, or an error number if an error occurred.
*/
#[Pure]
function bzdecompress ($data, $use_less_memory = 0) {}
function bzdecompress (string $data, bool $use_less_memory) {}

View File

@ -10,7 +10,7 @@
* </p>
* @return string The gregorian date as a string in the form "month/day/year"
*/
function jdtogregorian ($julian_day) {}
function jdtogregorian (int $julian_day) {}
/**
* Converts a Gregorian date to Julian Day Count
@ -26,7 +26,7 @@ function jdtogregorian ($julian_day) {}
* </p>
* @return int The julian day for the given gregorian date as an integer.
*/
function gregoriantojd ($month, $day, $year) {}
function gregoriantojd (int $month, int $day, int $year) {}
/**
* Converts a Julian Day Count to a Julian Calendar Date
@ -36,7 +36,7 @@ function gregoriantojd ($month, $day, $year) {}
* </p>
* @return string The julian date as a string in the form "month/day/year"
*/
function jdtojulian ($julian_day) {}
function jdtojulian (int $julian_day) {}
/**
* Converts a Julian Calendar date to Julian Day Count
@ -52,7 +52,7 @@ function jdtojulian ($julian_day) {}
* </p>
* @return int The julian day for the given julian date as an integer.
*/
function juliantojd ($month, $day, $year) {}
function juliantojd (int $month, int $day, int $year) {}
/**
* Converts a Julian day count to a Jewish calendar date
@ -71,7 +71,7 @@ function juliantojd ($month, $day, $year) {}
* </p>
* @return string The jewish date as a string in the form "month/day/year"
*/
function jdtojewish ($julian_day, $hebrew = false, $flags = 0) {}
function jdtojewish (int $julian_day, bool $hebrew = false, int $flags = 0) {}
/**
* Converts a date in the Jewish Calendar to Julian Day Count
@ -87,7 +87,7 @@ function jdtojewish ($julian_day, $hebrew = false, $flags = 0) {}
* </p>
* @return int The julian day for the given jewish date as an integer.
*/
function jewishtojd ($month, $day, $year) {}
function jewishtojd (int $month, int $day, int $year) {}
/**
* Converts a Julian Day Count to the French Republican Calendar
@ -95,7 +95,7 @@ function jewishtojd ($month, $day, $year) {}
* @param int $julian_day
* @return string The french revolution date as a string in the form "month/day/year"
*/
function jdtofrench ($julian_day) {}
function jdtofrench (int $julian_day) {}
/**
* Converts a date from the French Republican Calendar to a Julian Day Count
@ -111,7 +111,7 @@ function jdtofrench ($julian_day) {}
* </p>
* @return int The julian day for the given french revolution date as an integer.
*/
function frenchtojd ($month, $day, $year) {}
function frenchtojd (int $month, int $day, int $year) {}
/**
* Returns the day of the week
@ -148,7 +148,7 @@ function frenchtojd ($month, $day, $year) {}
* </table>
* @return mixed The gregorian weekday as either an integer or string.
*/
function jddayofweek ($julian_day, $mode = CAL_DOW_DAYNO) {}
function jddayofweek (int $julian_day, int $mode = CAL_DOW_DAYNO) {}
/**
* Returns a month name
@ -157,7 +157,7 @@ function jddayofweek ($julian_day, $mode = CAL_DOW_DAYNO) {}
* @param int $mode
* @return string The month name for the given Julian Day and <i>calendar</i>.
*/
function jdmonthname ($julian_day, $mode) {}
function jdmonthname (int $julian_day, int $mode) {}
/**
* Get Unix timestamp for midnight on Easter of a given year
@ -168,7 +168,7 @@ function jdmonthname ($julian_day, $mode) {}
* @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 ($year = null, $mode = CAL_EASTER_DEFAULT) {}
function easter_date (int $year, int $mode = CAL_EASTER_DEFAULT) {}
/**
* Get number of days after March 21 on which Easter falls for a given year
@ -185,7 +185,7 @@ function easter_date ($year = null, $mode = CAL_EASTER_DEFAULT) {}
* @return int The number of days after March 21st that the Easter Sunday
* is in the given <i>year</i>.
*/
function easter_days ($year = null, $mode = CAL_EASTER_DEFAULT) {}
function easter_days (int $year, int $mode = CAL_EASTER_DEFAULT) {}
/**
* Convert Unix timestamp to Julian Day
@ -195,7 +195,7 @@ function easter_days ($year = null, $mode = CAL_EASTER_DEFAULT) {}
* </p>
* @return int A julian day number as integer.
*/
function unixtojd ($timestamp = 0) {}
function unixtojd (int $timestamp = 0) {}
/**
* Convert Julian Day to Unix timestamp
@ -205,7 +205,7 @@ function unixtojd ($timestamp = 0) {}
* </p>
* @return int The unix timestamp for the start of the given julian day.
*/
function jdtounix ($julian_day) {}
function jdtounix (int $julian_day) {}
/**
* Converts from a supported calendar to Julian Day Count
@ -231,7 +231,7 @@ function jdtounix ($julian_day) {}
* </p>
* @return int A Julian Day number.
*/
function cal_to_jd ($calendar, $month, $day, $year) {}
function cal_to_jd (int $calendar, int $month, int $day, int $year) {}
/**
* Converts from Julian Day Count to a supported calendar
@ -246,7 +246,7 @@ function cal_to_jd ($calendar, $month, $day, $year) {}
* day of week, abbreviated and full names of weekday and month and the
* date in string form "month/day/year".
*/
function cal_from_jd ($julian_day, $calendar) {}
function cal_from_jd (int $julian_day, int $calendar) {}
/**
* Return the number of days in a month for a given year and calendar
@ -262,7 +262,7 @@ function cal_from_jd ($julian_day, $calendar) {}
* </p>
* @return int The length in days of the selected month in the given calendar
*/
function cal_days_in_month ($calendar, $month, $year) {}
function cal_days_in_month (int $calendar, int $month, int $year) {}
/**
* Returns information about a particular calendar
@ -273,7 +273,7 @@ function cal_days_in_month ($calendar, $month, $year) {}
* </p>
* @return array
*/
function cal_info ($calendar = -1) {}
function cal_info (int $calendar = -1) {}
define ('CAL_GREGORIAN', 0);
define ('CAL_JULIAN', 1);

View File

@ -12,7 +12,7 @@ use JetBrains\PhpStorm\Pure;
* a letter or a digit, <b>FALSE</b> otherwise.
*/
#[Pure]
function ctype_alnum ($text) {}
function ctype_alnum (mixed $text) {}
/**
* Check for alphabetic character(s)
@ -24,7 +24,7 @@ function ctype_alnum ($text) {}
* a letter from the current locale, <b>FALSE</b> otherwise.
*/
#[Pure]
function ctype_alpha ($text) {}
function ctype_alpha (mixed $text) {}
/**
* Check for control character(s)
@ -36,7 +36,7 @@ function ctype_alpha ($text) {}
* a control character from the current locale, <b>FALSE</b> otherwise.
*/
#[Pure]
function ctype_cntrl ($text) {}
function ctype_cntrl (mixed $text) {}
/**
* Check for numeric character(s)
@ -48,7 +48,7 @@ function ctype_cntrl ($text) {}
* <i>text</i> is a decimal digit, <b>FALSE</b> otherwise.
*/
#[Pure]
function ctype_digit ($text) {}
function ctype_digit (mixed $text) {}
/**
* Check for lowercase character(s)
@ -60,7 +60,7 @@ function ctype_digit ($text) {}
* a lowercase letter in the current locale.
*/
#[Pure]
function ctype_lower ($text) {}
function ctype_lower (mixed $text) {}
/**
* Check for any printable character(s) except space
@ -73,7 +73,7 @@ function ctype_lower ($text) {}
* otherwise.
*/
#[Pure]
function ctype_graph ($text) {}
function ctype_graph (mixed $text) {}
/**
* Check for printable character(s)
@ -87,7 +87,7 @@ function ctype_graph ($text) {}
* that do not have any output or control function at all.
*/
#[Pure]
function ctype_print ($text) {}
function ctype_print (mixed $text) {}
/**
* Check for any printable character which is not whitespace or an
@ -100,7 +100,7 @@ function ctype_print ($text) {}
* is printable, but neither letter, digit or blank, <b>FALSE</b> otherwise.
*/
#[Pure]
function ctype_punct ($text) {}
function ctype_punct (mixed $text) {}
/**
* Check for whitespace character(s)
@ -114,7 +114,7 @@ function ctype_punct ($text) {}
* carriage return and form feed characters.
*/
#[Pure]
function ctype_space ($text) {}
function ctype_space (mixed $text) {}
/**
* Check for uppercase character(s)
@ -126,7 +126,7 @@ function ctype_space ($text) {}
* an uppercase letter in the current locale.
*/
#[Pure]
function ctype_upper ($text) {}
function ctype_upper (mixed $text) {}
/**
* Check for character(s) representing a hexadecimal digit
@ -139,4 +139,4 @@ function ctype_upper ($text) {}
* [A-Fa-f] , <b>FALSE</b> otherwise.
*/
#[Pure]
function ctype_xdigit ($text) {}
function ctype_xdigit (mixed $text) {}

View File

@ -85,7 +85,7 @@ class CURLFile {
* </p>
* @return resource|false|CurlHandle a cURL handle on success, false on errors.
*/
function curl_init ($url = null) {}
function curl_init (string $url) {}
/**
* Copy a cURL handle along with all of its preferences
@ -2253,7 +2253,7 @@ function curl_share_setopt ($share_handle, $option, $value ) {}
* @since 5.5
*/
#[Pure]
function curl_strerror ($error_code) {}
function curl_strerror (int $error_code) {}
/**
* (PHP 5 &gt;=5.5.0)<br/>
@ -2469,7 +2469,7 @@ function curl_multi_setopt ($multi_handle, $option, $value) {}
* @return string|null Returns error string for valid error code, NULL otherwise.
* @since 5.5
*/
function curl_multi_strerror ($error_code) {}
function curl_multi_strerror (int $error_code) {}
/**
* (PHP 5 &gt;=5.5.0)<br/>
@ -2564,7 +2564,7 @@ function curl_share_errno($share_handle) {}
* @since 7.1
*/
#[Pure]
function curl_share_strerror($error_code){}
function curl_share_strerror(int $error_code){}
/**
* @since 8.0

View File

@ -20,7 +20,7 @@ use JetBrains\PhpStorm\Pure;
* this function would return -1 on failure.
*/
#[Pure]
function strtotime ($datetime, $baseTimestamp) {}
function strtotime (string $datetime, int $baseTimestamp) {}
/**
* Format a local time/date
@ -289,7 +289,7 @@ function strtotime ($datetime, $baseTimestamp) {}
* E_WARNING level error is emitted.
*/
#[Pure]
function date ($format, $timestamp) {}
function date (string $format, int $timestamp) {}
/**
* Format a local time/date as integer
@ -385,7 +385,7 @@ function date ($format, $timestamp) {}
* fewer digits than you would expect. See the example below.
*/
#[Pure]
function idate ($format, $timestamp = null) {}
function idate (string $format, int $timestamp) {}
/**
* Format a GMT/UTC date/time
@ -400,7 +400,7 @@ function idate ($format, $timestamp = null) {}
* E_WARNING level error is emitted.
*/
#[Pure]
function gmdate ($format, $timestamp = null) {}
function gmdate (string $format, int $timestamp) {}
/**
* Get Unix timestamp for a date
@ -502,7 +502,7 @@ function gmmktime ($hour = null, $minute = null, $second = null, $month = null,
* @return bool true if the date given is valid; otherwise returns false.
*/
#[Pure]
function checkdate ($month, $day, $year) {}
function checkdate (int $month, int $day, int $year) {}
/**
* Format a local time/date according to locale settings
@ -762,7 +762,8 @@ function checkdate ($month, $day, $year) {}
* other language-dependent strings respect the current locale set
* with setlocale.
*/
function strftime ($format, $timestamp = null) {}
function strftime (string $format, int $timestamp)
{}
/**
* Format a GMT/UTC time/date according to locale settings
@ -777,7 +778,7 @@ function strftime ($format, $timestamp = null) {}
* other language dependent strings respect the current locale set
* with setlocale.
*/
function gmstrftime ($format, $timestamp = null) {}
function gmstrftime (string $format, int $timestamp) {}
/**
* Return current Unix timestamp
@ -803,7 +804,7 @@ function time () {}
* @return array
*/
#[Pure]
function localtime ($timestamp = null, $associative = null) {}
function localtime (int $timestamp, bool $associative) {}
/**
* Get date/time information
@ -885,7 +886,7 @@ function localtime ($timestamp = null, $associative = null) {}
* </table>
*/
#[Pure]
function getdate ($timestamp = null) {}
function getdate (int $timestamp) {}
/**
* Returns new DateTime object
@ -899,7 +900,7 @@ function getdate ($timestamp = null) {}
* @return DateTime|false DateTime object on success or false on failure.
*/
#[Pure]
function date_create ($datetime = null, DateTimeZone $timezone = null ) {}
function date_create (string $datetime, DateTimeZone $timezone ) {}
/**
* (PHP 5.5)<br/>
@ -916,7 +917,7 @@ function date_create ($datetime = null, DateTimeZone $timezone = null ) {}
* @return DateTimeImmutable|false DateTime object on success or false on failure.
*/
#[Pure]
function date_create_immutable ($datetime = null, DateTimeZone $timezone = null ) {}
function date_create_immutable (string $datetime, DateTimeZone $timezone) {}
/**
* Returns new DateTimeImmutable object formatted according to the specified format
@ -927,7 +928,7 @@ function date_create_immutable ($datetime = null, DateTimeZone $timezone = null
* @return DateTimeImmutable
*/
#[Pure]
function date_create_immutable_from_format ($format, $datetime, DateTimeZone $timezone = null) {}
function date_create_immutable_from_format (string $format, string $datetime, DateTimeZone $timezone) {}
/**
* Alias:
@ -943,7 +944,7 @@ function date_create_immutable_from_format ($format, $datetime, DateTimeZone $ti
* {@see DateTime} instance or <b>FALSE</b> on failure.</p>
*/
#[Pure]
function date_create_from_format ($format, $datetime, $timezone = null) {}
function date_create_from_format (string $format, string $datetime, DateTimeZone $timezone) {}
/**
* Returns associative array with detailed info about given date
@ -955,7 +956,7 @@ function date_create_from_format ($format, $datetime, $timezone = null) {}
* on success or false on failure.
*/
#[Pure]
function date_parse ($datetime) {}
function date_parse (string $datetime) {}
/**
* Get info about given date formatted according to the specified format
@ -969,7 +970,7 @@ function date_parse ($datetime) {}
* @return array associative array with detailed info about given date.
*/
#[Pure]
function date_parse_from_format ($format, $datetime) {}
function date_parse_from_format (string $format, string $datetime) {}
/**
* Returns the warnings and errors
@ -990,7 +991,7 @@ function date_get_last_errors () {}
* @return string|false formatted date string on success or <b>FALSE</b> on failure.
*/
#[Pure]
function date_format (DateTimeInterface $object, $format) {}
function date_format (DateTimeInterface $object, string $format) {}
/**
* Alter the timestamp of a DateTime object by incrementing or decrementing
@ -1003,7 +1004,7 @@ function date_format (DateTimeInterface $object, $format) {}
* @return DateTime|false Returns the DateTime object for method chaining or <b>FALSE</b> on failure.
*/
#[Pure]
function date_modify ($object, $modifier) {}
function date_modify (DateTime $object, string $modifier) {}
/**
* &Alias; <methodname>DateTime::add</methodname>
@ -1033,7 +1034,7 @@ function date_add (DateTime $object, DateInterval $interval) {}
* {@see DateTime} object for method chaining or <b>FALSE</b> on failure.</p>
*/
#[Pure]
function date_sub ($object, $interval) {}
function date_sub (DateTime $object, DateInterval $interval) {}
/**
* Alias:
@ -1067,7 +1068,7 @@ function date_timezone_get (DateTimeInterface $object) {}
* {@see DateTime} object for method chaining or <b>FALSE</b> on failure.</p>
*/
#[Pure]
function date_timezone_set ($object, $timezone) {}
function date_timezone_set (DateTimeInterface $object, DateTimeZone $timezone) {}
/**
* Alias:
@ -1086,12 +1087,12 @@ function date_offset_get (DateTimeInterface $object) {}
* {@see DateTime::diff}
* @link https://php.net/manual/en/function.date-diff.php
* @param DateTime $baseObject
* @param DateTime $targetObject The date to compare to
* @param DateTimeInterface $targetObject The date to compare to
* @param bool $absolute [optional] Whether to return absolute difference.
* @return DateInterval|false The DateInterval object representing the difference between the two dates or FALSE on failure.
*/
#[Pure]
function date_diff ($baseObject, $targetObject, $absolute = false) {}
function date_diff (DateTimeInterface $baseObject, DateTimeInterface $targetObject, bool $absolute = false) {}
/**
* &Alias; <methodname>DateTime::setTime</methodname>
@ -1105,7 +1106,7 @@ function date_diff ($baseObject, $targetObject, $absolute = false) {}
* {@see DateTime} object for method chaining or <b>FALSE</b> on failure.</p>
*/
#[Pure]
function date_time_set (DateTime $object, int $hour, int $minute, $second = 0, $microsecond = 0) {}
function date_time_set (DateTime $object, int $hour, int $minute, int $second = 0, int $microsecond = 0) {}
/**
* &Alias; <methodname>DateTime::setDate</methodname>
@ -1122,7 +1123,7 @@ function date_time_set (DateTime $object, int $hour, int $minute, $second = 0, $
* {@see DateTime} object for method chaining or <b>FALSE</b> on failure.
* </p>
*/
function date_date_set (DateTime $object, $year, $month, $day) {}
function date_date_set (DateTime $object, int $year, int $month, int $day) {}
/**
* Alias:
@ -1136,7 +1137,7 @@ function date_date_set (DateTime $object, $year, $month, $day) {}
* Returns the {@see DateTime} object for method chaining or <strong><code>FALSE</code></strong> on failure.
* </p>
*/
function date_isodate_set ($object, $year, $week, $dayOfWeek = 1) {}
function date_isodate_set (DateTime $object, int $year, int $week, int $dayOfWeek = 1) {}
/**
* Sets the date and time based on an unix timestamp
@ -1149,7 +1150,7 @@ function date_isodate_set ($object, $year, $week, $dayOfWeek = 1) {}
* @return DateTime|false
* {@see DateTime} object for call chaining or <b>FALSE</b> on failure
*/
function date_timestamp_set ($object, $timestamp) {}
function date_timestamp_set (DateTime $object, int $timestamp) {}
/**
* Gets the unix timestamp
@ -1160,7 +1161,7 @@ function date_timestamp_set ($object, $timestamp) {}
* @return int <p>Returns the Unix timestamp representing the date.</p>
*/
#[Pure]
function date_timestamp_get ($object) {}
function date_timestamp_get (DateTimeInterface $object) {}
/**
* Returns new DateTimeZone object
@ -1172,7 +1173,7 @@ function date_timestamp_get ($object) {}
* @return DateTimeZone|false DateTimeZone object on success or false on failure.
*/
#[Pure]
function timezone_open ($timezone) {}
function timezone_open (string $timezone) {}
/**
* Alias: {@see DateTimeZone::getName}
@ -1205,7 +1206,8 @@ function timezone_name_get (DateTimeZone $object) {}
* @since 5.1.3
*/
#[Pure]
function timezone_name_from_abbr ($abbr, $utcOffset = null, $isDST = null) {}
function timezone_name_from_abbr (string $abbr, int $utcOffset, int $isDST)
{}
/**
* Alias:
@ -1234,7 +1236,7 @@ function timezone_offset_get (DateTimeZone $object, DateTimeInterface $datetime)
* @return array|false <p>Returns numerically indexed array containing associative array with all transitions on success or FALSE on failure.</p>
*/
#[Pure]
function timezone_transitions_get ($object, $timestampBegin, $timestampEnd) {}
function timezone_transitions_get (DateTimeZone $object, int $timestampBegin, int $timestampEnd) {}
/**
* &Alias; {@see DateTimeZone::getLocation}
@ -1256,7 +1258,7 @@ function timezone_location_get (DateTimeZone $object) {}
* Note: This option is only used when what is set to DateTimeZone::PER_COUNTRY.
*/
#[Pure]
function timezone_identifiers_list ($timezoneGroup = DateTimeZone::ALL, $countryCode = null) {}
function timezone_identifiers_list (int $timezoneGroup = DateTimeZone::ALL, string $countryCode) {}
/**
* Returns associative array containing dst, offset and the timezone name
@ -1288,17 +1290,17 @@ function timezone_version_get () {}
* <p>Returns a new DateInterval instance.</p>
*/
#[Pure]
function date_interval_create_from_date_string ($datetime) {}
function date_interval_create_from_date_string (string $datetime) {}
/**
* &Alias; <methodname>DateInterval::format</methodname>
* @link https://php.net/manual/en/function.date-interval-format.php
* @param $object
* @param $format
* @param DateInterval $object
* @param string $format
* @return DateInterval
*/
#[Pure]
function date_interval_format ($object, $format) {}
function date_interval_format (DateInterval $object, string $format) {}
/**
* Sets the default timezone used by all date/time functions in a script
@ -1312,7 +1314,8 @@ function date_interval_format ($object, $format) {}
* timezone_identifier isn't valid, or true
* otherwise.
*/
function date_default_timezone_set ($timezoneId) {}
function date_default_timezone_set (string $timezoneId): bool
{}
/**
* Gets the default timezone used by all date/time functions in a script
@ -1370,7 +1373,7 @@ function date_default_timezone_get () {}
* success or false on failure.
*/
#[Pure]
function date_sunrise ($timestamp, $returnFormat = null, $latitude = null, $longitude = null, $zenith = null, $utcOffset = null) {}
function date_sunrise (int $timestamp, int $returnFormat, float $latitude, float $longitude, float $zenith, float $utcOffset) {}
/**
* Returns time of sunset for a given day and location
@ -1420,7 +1423,7 @@ function date_sunrise ($timestamp, $returnFormat = null, $latitude = null, $long
* success or false on failure.
*/
#[Pure]
function date_sunset ($timestamp, $returnFormat = null, $latitude = null, $longitude = null, $zenith = null, $utcOffset = null) {}
function date_sunset (int $timestamp, int $returnFormat, float $latitude, float $longitude, float $zenith, float $utcOffset) {}
/**
* Returns an array with information about sunset/sunrise and twilight begin/end
@ -1438,6 +1441,6 @@ function date_sunset ($timestamp, $returnFormat = null, $latitude = null, $longi
* @since 5.1.2
*/
#[Pure]
function date_sun_info ($timestamp, $latitude, $longitude) {}
function date_sun_info (int $timestamp, float $latitude, float $longitude) {}
// End of date v.5.3.2-0.dotdeb.1

View File

@ -119,7 +119,8 @@
* @param mixed ...$handler_params [optional]
* @return resource|false a positive handle on success or <b>FALSE</b> on failure.
*/
function dba_open ($path, $mode, $handler = null, ...$handler_params) {}
function dba_open ($path, $mode, $handler, ...$handler_params)
{}
/**
* Open database persistently
@ -142,7 +143,8 @@ function dba_open ($path, $mode, $handler = null, ...$handler_params) {}
* @param mixed ...$handler_params [optional]
* @return resource|false a positive handle on success or <b>FALSE</b> on failure.
*/
function dba_popen ($path, $mode, $handler = null, ...$handler_params) {}
function dba_popen ($path, $mode, $handler, ...$handler_params)
{}
/**
* Close a DBA database
@ -241,7 +243,7 @@ function dba_fetch ($key, $skip, $dba) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function dba_insert ($key, $value, $dba) {}
function dba_insert ($key, string $value, $dba) {}
/**
* Replace or insert entry
@ -258,7 +260,7 @@ function dba_insert ($key, $value, $dba) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function dba_replace ($key, $value, $dba) {}
function dba_replace ($key, string $value, $dba) {}
/**
* Fetch first key
@ -319,7 +321,7 @@ function dba_sync ($dba) {}
* When the internal cdb library is used you will see
* cdb and cdb_make.
*/
function dba_handlers ($full_info = false) {}
function dba_handlers (bool $full_info = false) {}
/**
* List all open database files
@ -331,13 +333,13 @@ function dba_list () {}
/**
* Splits a key in string representation into array representation
* @link https://php.net/manual/en/function.dba-key-split.php
* @param mixed $key <p>
* @param string|false|null $key <p>
* The key in string representation.
* </p>
* @return array|false an array of the form array(0 =&gt; group, 1 =&gt;
* value_name). This function will return <b>FALSE</b> if
* <i>key</i> is <b>NULL</b> or <b>FALSE</b>.
*/
function dba_key_split ($key) {}
function dba_key_split (string|false|null $key) {}
// End of dba v.

View File

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

View File

@ -6,12 +6,12 @@ use JetBrains\PhpStorm\Deprecated;
/**
* Reads the EXIF headers from JPEG or TIFF
* @link https://php.net/manual/en/function.exif-read-data.php
* @param string|resource $file <p>
* @param string $file <p>
* The location of the image file. This cannot be an URL.
* 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 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,8 @@ 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, $required_sections = null, $as_arrays = false, $read_thumbnail = false) {}
function exif_read_data ($file, string $required_sections, bool $as_arrays = false, bool $read_thumbnail = false)
{}
/**
* Alias of <b>exif_read_data</b>
@ -100,7 +101,7 @@ function read_exif_data ($filename, $sections = null, $arrays = false, $thumbnai
* @return string|false the header name, or <b>FALSE</b> if <i>index</i> is
* not a defined EXIF tag id.
*/
function exif_tagname ($index) {}
function exif_tagname (int $index) {}
/**
* Retrieve the embedded thumbnail of a TIFF or JPEG image
@ -123,7 +124,7 @@ function exif_tagname ($index) {}
* @return string|false the embedded thumbnail, or <b>FALSE</b> if the image contains no
* thumbnail.
*/
function exif_thumbnail ($file, &$width = null, &$height = null, &$image_type = null) {}
function exif_thumbnail ($file, &$width, &$height, &$image_type) {}
/**
* Determine the type of an image
@ -139,7 +140,7 @@ function exif_thumbnail ($file, &$width = null, &$height = null, &$image_type =
* and return <b>FALSE</b> if it is unable to read enough bytes from the file to
* determine the image type.
*/
function exif_imagetype ($filename) {}
function exif_imagetype (string $filename) {}
define ('EXIF_USE_MBSTRING', 1);

View File

@ -82,7 +82,7 @@ class finfo {
* </p>
* @return resource|false a magic database resource on success or <b>FALSE</b> on failure.
*/
function finfo_open ($flags = null, $magic_database = null) {}
function finfo_open (int $flags, string $magic_database) {}
/**
* (PHP &gt;= 5.3.0, PECL fileinfo &gt;= 0.1.0)<br/>
@ -108,7 +108,7 @@ function finfo_close ($finfo) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function finfo_set_flags ($finfo, $flags) {}
function finfo_set_flags ($finfo, int $flags) {}
/**
* (PHP &gt;= 5.3.0, PECL fileinfo &gt;= 0.1.0)<br/>
@ -130,7 +130,8 @@ function finfo_set_flags ($finfo, $flags) {}
* @return mixed a textual description of the contents of the
* <i>filename</i> argument, or <b>FALSE</b> if an error occurred.
*/
function finfo_file ($finfo, $filename, $flags = null, $context = null) {}
function finfo_file ($finfo, string $filename, int $flags, $context)
{}
/**
* (PHP 5 &gt;= 5.3.0, PECL fileinfo &gt;= 0.1.0)<br/>
@ -155,7 +156,7 @@ function finfo_file ($finfo, $filename, $flags = null, $context = null) {}
* @return string|false a textual description of the <i>string</i>
* argument, or <b>FALSE</b> if an error occurred.
*/
function finfo_buffer ($finfo , $string, $flags = FILEINFO_NONE, $context = null) {}
function finfo_buffer ($finfo , string $string, int $flags = FILEINFO_NONE, $context) {}
/**
* Detect MIME Content-type for a file

View File

@ -18,7 +18,7 @@ use JetBrains\PhpStorm\Pure;
* The ID of the filter to apply. The
* manual page lists the available filters.
* </p>
* @param mixed $options [optional] <p>
* @param array|int $options [optional] <p>
* Associative array of options or bitwise disjunction of flags. If filter
* accepts options, flags can be provided in "flags" field of array.
* </p>
@ -28,7 +28,7 @@ use JetBrains\PhpStorm\Pure;
* returns <b>FALSE</b> if the variable is not set and <b>NULL</b> if the filter fails.
*/
#[Pure]
function filter_input ($type, $var_name, $filter = FILTER_DEFAULT, $options = null) {}
function filter_input (int $type, string $var_name, int $filter = FILTER_DEFAULT, array|int $options) {}
/**
* Filters a variable with a specified filter
@ -40,7 +40,7 @@ function filter_input ($type, $var_name, $filter = FILTER_DEFAULT, $options = nu
* The ID of the filter to apply. The
* manual page lists the available filters.
* </p>
* @param mixed $options [optional] <p>
* @param array|int $options [optional] <p>
* Associative array of options or bitwise disjunction of flags. If filter
* accepts options, flags can be provided in "flags" field of array. For
* the "callback" filter, callable type should be passed. The
@ -84,7 +84,7 @@ function filter_input ($type, $var_name, $filter = FILTER_DEFAULT, $options = nu
* @return mixed the filtered data, or <b>FALSE</b> if the filter fails.
*/
#[Pure]
function filter_var ($value, $filter = FILTER_DEFAULT, $options = null) {}
function filter_var (mixed $value, int $filter = FILTER_DEFAULT, array|int $options) {}
/**
* Gets external variables and optionally filters them
@ -94,7 +94,7 @@ function filter_var ($value, $filter = FILTER_DEFAULT, $options = null) {}
* <b>INPUT_COOKIE</b>, <b>INPUT_SERVER</b>, or
* <b>INPUT_ENV</b>.
* </p>
* @param mixed $options [optional] <p>
* @param array|int $options [optional] <p>
* An array defining the arguments. A valid key is a string
* containing a variable name and a valid value is either a filter type, or an array
* optionally specifying the filter, flags and options. If the value is an
@ -118,7 +118,7 @@ function filter_var ($value, $filter = FILTER_DEFAULT, $options = null) {}
* fails.
*/
#[Pure]
function filter_input_array ($type, $options = null, $add_empty = true) {}
function filter_input_array (int $type, array|int $options, bool $add_empty = true) {}
/**
* Gets multiple variables and optionally filters them
@ -126,7 +126,7 @@ function filter_input_array ($type, $options = null, $add_empty = true) {}
* @param array $array <p>
* An array with string keys containing the data to filter.
* </p>
* @param mixed $options [optional] <p>
* @param array|int $options [optional] <p>
* An array defining the arguments. A valid key is a string
* containing a variable name and a valid value is either a
* filter type, or an
@ -149,7 +149,7 @@ function filter_input_array ($type, $options = null, $add_empty = true) {}
* the variable is not set.
*/
#[Pure]
function filter_var_array (array $array, $options = null, $add_empty = true) {}
function filter_var_array (array $array, array|int $options, bool $add_empty = true) {}
/**
* Returns a list of all supported filters
@ -175,7 +175,7 @@ function filter_list () {}
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
#[Pure]
function filter_has_var ($input_type, $var_name) {}
function filter_has_var (int $input_type, string $var_name) {}
/**
* Returns the filter ID belonging to a named filter
@ -186,7 +186,7 @@ function filter_has_var ($input_type, $var_name) {}
* @return int|false ID of a filter on success or <b>FALSE</b> if filter doesn't exist.
*/
#[Pure]
function filter_id ($name) {}
function filter_id (string $name) {}
/**

View File

@ -11,7 +11,7 @@
* @return bool
* @since 7.2
*/
function ftp_append ($ftp, $remote_filename, $local_filename, $mode = FTP_BINARY){}
function ftp_append ($ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY){}
/**
* returns a list of files in the given directory
@ -20,7 +20,7 @@ function ftp_append ($ftp, $remote_filename, $local_filename, $mode = FTP_BINARY
* @return array
* @since 7.2
*/
function ftp_mlsd ($ftp, $directory) {}
function ftp_mlsd ($ftp, string $directory) {}
/**
* Opens an FTP connection
@ -41,7 +41,7 @@ function ftp_mlsd ($ftp, $directory) {}
* </p>
* @return resource|false a FTP stream on success or <b>FALSE</b> on error.
*/
function ftp_connect ($hostname, $port = 21, $timeout = 90) {}
function ftp_connect (string $hostname, int $port = 21, int $timeout = 90) {}
/**
* Opens a Secure SSL-FTP connection
@ -62,7 +62,7 @@ function ftp_connect ($hostname, $port = 21, $timeout = 90) {}
* </p>
* @return resource|false a SSL-FTP stream on success or <b>FALSE</b> on error.
*/
function ftp_ssl_connect ($hostname, $port = 21, $timeout = 90) {}
function ftp_ssl_connect (string $hostname, int $port = 21, int $timeout = 90) {}
/**
* Logs in to an FTP connection
@ -79,7 +79,7 @@ function ftp_ssl_connect ($hostname, $port = 21, $timeout = 90) {}
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
* If login fails, PHP will also throw a warning.
*/
function ftp_login ($ftp, $username, $password) {}
function ftp_login ($ftp, string $username, string $password) {}
/**
* Returns the current directory name
@ -113,7 +113,7 @@ function ftp_cdup ($ftp) {}
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
* If changing directory fails, PHP will also throw a warning.
*/
function ftp_chdir ($ftp, $directory) {}
function ftp_chdir ($ftp, string $directory) {}
/**
* Requests execution of a command on the FTP server
@ -127,7 +127,7 @@ function ftp_chdir ($ftp, $directory) {}
* @return bool <b>TRUE</b> if the command was successful (server sent response code:
* 200); otherwise returns <b>FALSE</b>.
*/
function ftp_exec ($ftp, $command) {}
function ftp_exec ($ftp, string $command) {}
/**
* Sends an arbitrary command to an FTP server
@ -142,7 +142,7 @@ function ftp_exec ($ftp, $command) {}
* No parsing is performed on the response string, nor does
* <b>ftp_raw</b> determine if the command succeeded.
*/
function ftp_raw ($ftp, $command) {}
function ftp_raw ($ftp, string $command) {}
/**
* Creates a directory
@ -155,7 +155,7 @@ function ftp_raw ($ftp, $command) {}
* </p>
* @return string|false the newly created directory name on success or <b>FALSE</b> on error.
*/
function ftp_mkdir ($ftp, $directory) {}
function ftp_mkdir ($ftp, string $directory) {}
/**
* Removes a directory
@ -169,7 +169,7 @@ function ftp_mkdir ($ftp, $directory) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ftp_rmdir ($ftp, $directory) {}
function ftp_rmdir ($ftp, string $directory) {}
/**
* Set permissions on a file via FTP
@ -185,7 +185,7 @@ function ftp_rmdir ($ftp, $directory) {}
* </p>
* @return int|false the new file permissions on success or <b>FALSE</b> on error.
*/
function ftp_chmod ($ftp, $permissions, $filename) {}
function ftp_chmod ($ftp, int $permissions, string $filename) {}
/**
* Allocates space for a file to be uploaded
@ -202,7 +202,8 @@ function ftp_chmod ($ftp, $permissions, $filename) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ftp_alloc ($ftp, $size, &$response = null) {}
function ftp_alloc ($ftp, int $size, &$response)
{}
/**
* Returns a list of files in the given directory
@ -219,7 +220,7 @@ function ftp_alloc ($ftp, $size, &$response = null) {}
* @return array|false an array of filenames from the specified directory on success or
* <b>FALSE</b> on error.
*/
function ftp_nlist ($ftp, $directory) {}
function ftp_nlist ($ftp, string $directory) {}
/**
* Returns a detailed list of files in the given directory
@ -241,7 +242,7 @@ function ftp_nlist ($ftp, $directory) {}
* <b>ftp_systype</b> can be used to determine how the results
* should be interpreted.
*/
function ftp_rawlist ($ftp, $directory, $recursive = false) {}
function ftp_rawlist ($ftp, string $directory, bool $recursive = false) {}
/**
* Returns the system type identifier of the remote FTP server
@ -264,7 +265,7 @@ function ftp_systype ($ftp) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ftp_pasv ($ftp, $enable) {}
function ftp_pasv ($ftp, bool $enable) {}
/**
* Downloads a file from the FTP server
@ -287,7 +288,7 @@ function ftp_pasv ($ftp, $enable) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ftp_get ($ftp, $local_filename, $remote_filename, $mode = FTP_BINARY, $offset = 0) {}
function ftp_get ($ftp, string $local_filename, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0) {}
/**
* Downloads a file from the FTP server and saves to an open file
@ -310,7 +311,7 @@ function ftp_get ($ftp, $local_filename, $remote_filename, $mode = FTP_BINARY, $
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ftp_fget ($ftp, $stream, $remote_filename, $mode = FTP_BINARY, $offset = 0) {}
function ftp_fget ($ftp, $stream, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0) {}
/**
* Uploads a file to the FTP server
@ -331,7 +332,7 @@ function ftp_fget ($ftp, $stream, $remote_filename, $mode = FTP_BINARY, $offset
* @param int $offset [optional] <p>The position in the remote file to start uploading to.</p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ftp_put ($ftp, $remote_filename, $local_filename, $mode = FTP_BINARY, $offset = 0) {}
function ftp_put ($ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY, int $offset = 0) {}
/**
* Uploads from an open file to the FTP server
@ -352,7 +353,7 @@ function ftp_put ($ftp, $remote_filename, $local_filename, $mode = FTP_BINARY, $
* @param int $offset [optional] <p>The position in the remote file to start uploading to.</p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ftp_fput ($ftp, $remote_filename, $stream, $mode = FTP_BINARY, $offset = 0) {}
function ftp_fput ($ftp, string $remote_filename, $stream, int $mode = FTP_BINARY, int $offset = 0) {}
/**
* Returns the size of the given file
@ -365,7 +366,7 @@ function ftp_fput ($ftp, $remote_filename, $stream, $mode = FTP_BINARY, $offset
* </p>
* @return int the file size on success, or -1 on error.
*/
function ftp_size ($ftp, $filename) {}
function ftp_size ($ftp, string $filename) {}
/**
* Returns the last modified time of the given file
@ -379,7 +380,7 @@ function ftp_size ($ftp, $filename) {}
* @return int the last modified time as a Unix timestamp on success, or -1 on
* error.
*/
function ftp_mdtm ($ftp, $filename) {}
function ftp_mdtm ($ftp, string $filename) {}
/**
* Renames a file or a directory on the FTP server
@ -395,7 +396,7 @@ function ftp_mdtm ($ftp, $filename) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ftp_rename ($ftp, $from, $to) {}
function ftp_rename ($ftp, string $from, string $to) {}
/**
* Deletes a file on the FTP server
@ -408,7 +409,7 @@ function ftp_rename ($ftp, $from, $to) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ftp_delete ($ftp, $filename) {}
function ftp_delete ($ftp, string $filename) {}
/**
* Sends a SITE command to the server
@ -422,7 +423,7 @@ function ftp_delete ($ftp, $filename) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ftp_site ($ftp, $command) {}
function ftp_site ($ftp, string $command) {}
/**
* Closes an FTP connection
@ -472,7 +473,7 @@ function ftp_close ($ftp) {}
* supported or the passed <i>value</i> doesn't match the
* expected value for the given <i>option</i>.
*/
function ftp_set_option ($ftp, $option, $value) {}
function ftp_set_option ($ftp, int $option, $value) {}
/**
* Retrieves various runtime behaviours of the current FTP stream
@ -502,7 +503,7 @@ function ftp_set_option ($ftp, $option, $value) {}
* <i>option</i> is not supported. In the latter case, a
* warning message is also thrown.
*/
function ftp_get_option ($ftp, $option) {}
function ftp_get_option ($ftp, int $option) {}
/**
* Retrieves a file from the FTP server and writes it to an open file (non-blocking)
@ -524,7 +525,7 @@ function ftp_get_option ($ftp, $option) {}
* @return int <b>FTP_FAILED</b> or <b>FTP_FINISHED</b>
* or <b>FTP_MOREDATA</b>.
*/
function ftp_nb_fget ($ftp, $stream, $remote_filename, $mode = FTP_BINARY, $offset = 0) {}
function ftp_nb_fget ($ftp, $stream, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0) {}
/**
* Retrieves a file from the FTP server and writes it to a local file (non-blocking)
@ -546,7 +547,7 @@ function ftp_nb_fget ($ftp, $stream, $remote_filename, $mode = FTP_BINARY, $offs
* @return int <b>FTP_FAILED</b> or <b>FTP_FINISHED</b>
* or <b>FTP_MOREDATA</b>.
*/
function ftp_nb_get ($ftp, $local_filename, $remote_filename, $mode = FTP_BINARY, $offset = 0) {}
function ftp_nb_get ($ftp, string $local_filename, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0) {}
/**
* Continues retrieving/sending a file (non-blocking)
@ -579,7 +580,7 @@ function ftp_nb_continue ($ftp) {}
* @return int <b>FTP_FAILED</b> or <b>FTP_FINISHED</b>
* or <b>FTP_MOREDATA</b>.
*/
function ftp_nb_put ($ftp, $remote_filename, $local_filename, $mode = FTP_BINARY, $offset = 0) {}
function ftp_nb_put ($ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY, int $offset = 0) {}
/**
* Stores a file from an open file to the FTP server (non-blocking)
@ -601,7 +602,7 @@ function ftp_nb_put ($ftp, $remote_filename, $local_filename, $mode = FTP_BINARY
* @return int <b>FTP_FAILED</b> or <b>FTP_FINISHED</b>
* or <b>FTP_MOREDATA</b>.
*/
function ftp_nb_fput ($ftp, $remote_filename, $stream, $mode = FTP_BINARY, $offset = 0) {}
function ftp_nb_fput ($ftp, string $remote_filename, $stream, int $mode = FTP_BINARY, int $offset = 0) {}
/**
* Alias of <b>ftp_close</b>

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|null $domain <p>
* @param string $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 ($domain) {}
function textdomain (string $domain) {}
/**
* Lookup a message in the current domain
@ -25,7 +25,7 @@ function textdomain ($domain) {}
* translation table, or the submitted message if not found.
*/
#[Pure]
function _ ($message) {}
function _ (string $message) {}
/**
* Lookup a message in the current domain
@ -37,7 +37,7 @@ function _ ($message) {}
* translation table, or the submitted message if not found.
*/
#[Pure]
function gettext ($message) {}
function gettext (string $message) {}
/**
* Override the current domain
@ -50,7 +50,7 @@ function gettext ($message) {}
* </p>
* @return string A string on success.
*/
function dgettext ($domain, $message) {}
function dgettext (string $domain, string $message) {}
/**
* Overrides the domain for a single lookup
@ -66,7 +66,7 @@ function dgettext ($domain, $message) {}
* </p>
* @return string A string on success.
*/
function dcgettext ($domain, $message, $category) {}
function dcgettext (string $domain, string $message, int $category) {}
/**
* Sets the path for a domain
@ -79,7 +79,7 @@ function dcgettext ($domain, $message, $category) {}
* </p>
* @return string The full pathname for the <i>domain</i> currently being set.
*/
function bindtextdomain ($domain, $directory) {}
function bindtextdomain (string $domain, string $directory) {}
/**
* Plural version of gettext
@ -92,7 +92,7 @@ function bindtextdomain ($domain, $directory) {}
* for count <i>n</i>.
*/
#[Pure]
function ngettext ($singular, $plural, $count) {}
function ngettext (string $singular, string $plural, int $count) {}
/**
* Plural version of dgettext
@ -106,7 +106,7 @@ function ngettext ($singular, $plural, $count) {}
* @return string A string on success.
*/
#[Pure]
function dngettext ($domain, $singular, $plural, $count) {}
function dngettext (string $domain, string $singular, string $plural, int $count) {}
/**
* Plural version of dcgettext
@ -121,7 +121,7 @@ function dngettext ($domain, $singular, $plural, $count) {}
* @return string A string on success.
*/
#[Pure]
function dcngettext ($domain, $singular, $plural, $count, $category) {}
function dcngettext (string $domain, string $singular, string $plural, int $count, int $category) {}
/**
* Specify the character encoding in which the messages from the DOMAIN message catalog will be returned
@ -134,7 +134,7 @@ function dcngettext ($domain, $singular, $plural, $count, $category) {}
* </p>
* @return string A string on success.
*/
function bind_textdomain_codeset ($domain, $codeset) {}
function bind_textdomain_codeset (string $domain, string $codeset) {}
// End of gettext v.
?>

View File

@ -22,7 +22,7 @@ use JetBrains\PhpStorm\Pure;
* binary representation of the message digest is returned.
*/
#[Pure]
function hash ($algo, $data, $binary = false) {}
function hash (string $algo, string $data, bool $binary = false) {}
/**
* Timing attack safe string comparison
@ -33,7 +33,7 @@ function hash ($algo, $data, $binary = false) {}
* @since 5.6
*/
#[Pure]
function hash_equals($known_string, $user_string) {}
function hash_equals(string $known_string, string $user_string) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL hash &gt;= 1.1)<br/>
@ -54,7 +54,7 @@ function hash_equals($known_string, $user_string) {}
* binary representation of the message digest is returned.
*/
#[Pure]
function hash_file ($algo, $filename, $binary = false) {}
function hash_file (string $algo, string $filename, bool $binary = false) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL hash &gt;= 1.1)<br/>
@ -79,7 +79,7 @@ function hash_file ($algo, $filename, $binary = false) {}
* binary representation of the message digest is returned.
*/
#[Pure]
function hash_hmac ($algo, $data, $key, $binary = false) {}
function hash_hmac (string $algo, string $data, string $key, bool $binary = false) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL hash &gt;= 1.1)<br/>
@ -104,7 +104,7 @@ function hash_hmac ($algo, $data, $key, $binary = false) {}
* binary representation of the message digest is returned.
*/
#[Pure]
function hash_hmac_file ($algo, $data, $key, $binary = false) {}
function hash_hmac_file (string $algo, string $data, string $key, bool $binary = false) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL hash &gt;= 1.1)<br/>
@ -129,7 +129,8 @@ function hash_hmac_file ($algo, $data, $key, $binary = false) {}
* and <b>hash_final</b>.
*/
#[Pure]
function hash_init ($algo, $flags = 0, $key = null) {}
function hash_init (string $algo, int $flags = 0, string $key)
{}
/**
* (PHP 5 &gt;= 5.1.2, PECL hash &gt;= 1.1)<br/>
@ -143,7 +144,7 @@ function hash_init ($algo, $flags = 0, $key = null) {}
* </p>
* @return bool <b>TRUE</b>.
*/
function hash_update ($context, $data) {}
function hash_update ($context, string $data){}
/**
* (PHP 5 &gt;= 5.1.2, PECL hash &gt;= 1.1)<br/>
@ -161,7 +162,8 @@ function hash_update ($context, $data) {}
* </p>
* @return int Actual number of bytes added to the hashing context from <i>handle</i>.
*/
function hash_update_stream ($context, $stream, $length = -1) {}
function hash_update_stream ($context, $stream, int $length = -1)
{}
/**
* (PHP 5 &gt;= 5.1.2, PECL hash &gt;= 1.1)<br/>
@ -178,7 +180,8 @@ function hash_update_stream ($context, $stream, $length = -1) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function hash_update_file ($context, $filename, $stream_context = null) {}
function hash_update_file ($context, string $filename, $stream_context = null)
{}
/**
* (PHP 5 &gt;= 5.1.2, PECL hash &gt;= 1.1)<br/>
@ -195,7 +198,8 @@ function hash_update_file ($context, $filename, $stream_context = null) {}
* unless <i>raw_output</i> is set to true in which case the raw
* binary representation of the message digest is returned.
*/
function hash_final ($context, $binary = false) {}
function hash_final ($context, bool $binary = false)
{}
/**
* Copy hashing context
@ -281,7 +285,7 @@ function hash_hmac_algos() {}
* @since 5.5
*/
#[Pure]
function hash_pbkdf2 ($algo, $password, $salt, $iterations, $length = 0, $binary = false) {}
function hash_pbkdf2 (string $algo, string $password, string $salt, int $iterations, int $length = 0, bool $binary = false) {}
/**
* Generates a key
@ -306,7 +310,7 @@ function hash_pbkdf2 ($algo, $password, $salt, $iterations, $length = 0, $binary
* @return string|false the generated key as a string, or <b>FALSE</b> on error.
*/
#[Pure]
function mhash_keygen_s2k ($algo, $password, $salt, $length) {}
function mhash_keygen_s2k (int $algo, string $password, string $salt, int $length) {}
/**
* Gets the block size of the specified hash
@ -318,7 +322,7 @@ function mhash_keygen_s2k ($algo, $password, $salt, $length) {}
* does not exist.
*/
#[Pure]
function mhash_get_block_size ($algo) {}
function mhash_get_block_size (int $algo) {}
/**
* Gets the name of the specified hash
@ -329,7 +333,7 @@ function mhash_get_block_size ($algo) {}
* @return string|false the name of the hash or <b>FALSE</b>, if the hash does not exist.
*/
#[Pure]
function mhash_get_hash_name ($algo) {}
function mhash_get_hash_name (int $algo) {}
/**
* Gets the highest available hash ID
@ -359,7 +363,8 @@ function mhash_count () {}
* <b>FALSE</b> on error.
*/
#[Pure]
function mhash ($algo, $data, $key = null) {}
function mhash (int $algo, string $data, string $key)
{}
/**

View File

@ -28,7 +28,7 @@ use JetBrains\PhpStorm\Pure;
* @return string|false the converted string or <b>FALSE</b> on failure.
*/
#[Pure]
function iconv ($from_encoding, $to_encoding, $string) {}
function iconv (string $from_encoding, string $to_encoding, string $string) {}
/**
* Convert character encoding as output buffer handler
@ -39,7 +39,7 @@ function iconv ($from_encoding, $to_encoding, $string) {}
* return values.
*/
#[Pure]
function ob_iconv_handler ($contents, $status) {}
function ob_iconv_handler (string $contents, int $status) {}
/**
* Retrieve internal configuration variables of iconv extension
@ -61,7 +61,7 @@ function ob_iconv_handler ($contents, $status) {}
* </p>
*/
#[Pure]
function iconv_get_encoding ($type = "all") {}
function iconv_get_encoding (string $type = "all") {}
/**
* Set current setting for character encoding conversion
@ -77,7 +77,7 @@ function iconv_get_encoding ($type = "all") {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function iconv_set_encoding ($type, $encoding) {}
function iconv_set_encoding (string $type, string $encoding) {}
/**
* Returns the character count of string
@ -93,7 +93,7 @@ function iconv_set_encoding ($type, $encoding) {}
* @return int|false the character count of <i>str</i>, as an integer. False on error.
*/
#[Pure]
function iconv_strlen ($string, $encoding = 'ini_get("iconv.internal_encoding")') {}
function iconv_strlen (string $string, string $encoding = 'ini_get("iconv.internal_encoding")') {}
/**
* Cut out part of a string
@ -149,7 +149,8 @@ function iconv_strlen ($string, $encoding = 'ini_get("iconv.internal_encoding")'
* </p>
*/
#[Pure]
function iconv_substr ($string, $offset, $length = 'iconv_strlen($str, $charset)', $encoding = 'ini_get("iconv.internal_encoding")') {}
function iconv_substr (string $string, int $offset, int $length, string $encoding = 'ini_get("iconv.internal_encoding")')
{}
/**
* Finds position of first occurrence of a needle within a haystack
@ -178,7 +179,7 @@ function iconv_substr ($string, $offset, $length = 'iconv_strlen($str, $charset)
* </p>
*/
#[Pure]
function iconv_strpos ($haystack, $needle, $offset = 0, $encoding = 'ini_get("iconv.internal_encoding")') {}
function iconv_strpos (string $haystack, string $needle, int $offset = 0, string $encoding = 'ini_get("iconv.internal_encoding")') {}
/**
* Finds the last occurrence of a needle within a haystack
@ -203,7 +204,7 @@ function iconv_strpos ($haystack, $needle, $offset = 0, $encoding = 'ini_get("ic
* </p>
*/
#[Pure]
function iconv_strrpos ($haystack, $needle, $encoding = 'ini_get("iconv.internal_encoding")') {}
function iconv_strrpos (string $haystack, string $needle, string $encoding = 'ini_get("iconv.internal_encoding")') {}
/**
* Composes a MIME header field
@ -304,7 +305,8 @@ function iconv_strrpos ($haystack, $needle, $encoding = 'ini_get("iconv.internal
* or <b>FALSE</b> if an error occurs during the encoding.
*/
#[Pure]
function iconv_mime_encode ($field_name, $field_value, array $options = null) {}
function iconv_mime_encode (string $field_name, string $field_value, array $options)
{}
/**
* Decodes a MIME header field
@ -356,7 +358,7 @@ function iconv_mime_encode ($field_name, $field_value, array $options = null) {}
* or <b>FALSE</b> if an error occurs during the decoding.
*/
#[Pure]
function iconv_mime_decode ($string, $mode = 0, $encoding = 'ini_get("iconv.internal_encoding")') {}
function iconv_mime_decode (string $string, int $mode = 0, string $encoding = 'ini_get("iconv.internal_encoding")') {}
/**
* Decodes multiple MIME header fields at once
@ -418,7 +420,7 @@ function iconv_mime_decode ($string, $mode = 0, $encoding = 'ini_get("iconv.inte
* </p>
*/
#[Pure]
function iconv_mime_decode_headers ($headers, $mode = 0, $encoding = 'ini_get("iconv.internal_encoding")') {}
function iconv_mime_decode_headers (string $headers, int $mode = 0, string $encoding = 'ini_get("iconv.internal_encoding")') {}
/**

View File

@ -92,7 +92,7 @@ class JsonIncrementalParser {
* </p>
* @return string|false a JSON encoded string on success or <b>FALSE</b> on failure.
*/
function json_encode ($value, $flags = 0, $depth = 512) {}
function json_encode (mixed $value, int $flags = 0, int $depth = 512) {}
/**
* (PHP 5 &gt;= 5.2.0, PECL json &gt;= 1.2.0)<br/>
@ -130,7 +130,7 @@ function json_encode ($value, $flags = 0, $depth = 512) {}
* <i>json</i> cannot be decoded or if the encoded
* data is deeper than the recursion limit.
*/
function json_decode ($json, $associative = false, $depth = 512, $flags = 0) {}
function json_decode (string $json, bool $associative = false, int $depth = 512, int $flags = 0) {}
/**
* Returns the last error occurred

View File

@ -14,7 +14,7 @@ use JetBrains\PhpStorm\Deprecated;
* @return string|bool Returns the generated password if newpw is empty or omitted. Otherwise returns TRUE on success and FALSE on failure.
* @since 7.2
*/
function ldap_exop_passwd ($ldap , $user = "" , $old_password = "" , $new_password = "" , array &$controls = []) {}
function ldap_exop_passwd ($ldap , string $user = "" , string $old_password = "" , string $new_password = "" , &$controls = []) {}
/**
* Refresh extended operation helper
@ -25,7 +25,7 @@ function ldap_exop_passwd ($ldap , $user = "" , $old_password = "" , $new_passwo
* @return int|false From RFC: The responseTtl field is the time in seconds which the server chooses to have as the time-to-live field for that entry. It must not be any smaller than that which the client requested, and it may be larger. However, to allow servers to maintain a relatively accurate directory, and to prevent clients from abusing the dynamic extensions, servers are permitted to shorten a client-requested time-to-live value, down to a minimum of 86400 seconds (one day). FALSE will be returned on error.
* @since 7.3
*/
function ldap_exop_refresh ($ldap, $dn, $ttl) {}
function ldap_exop_refresh ($ldap, string $dn, int $ttl) {}
/**
* WHOAMI extended operation helper
@ -48,7 +48,7 @@ function ldap_exop_whoami ($ldap) {}
* @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 , $request_oid , $request_data = null , $controls = [], &$response_data, &$response_oid) {}
function ldap_exop ($ldap , string $request_oid , string $request_data , array $controls = [], &$response_data, &$response_oid) {}
/**
* Parse LDAP extended operation data from result object result
@ -68,7 +68,7 @@ function ldap_parse_exop ($ldap , $result, &$response_data, &$response_oid) {}
* @param string $value
* @return string
*/
function ldap_8859_to_t61($value) {}
function ldap_8859_to_t61(string $value) {}
/**
* Translate t61 characters to 8859 characters
@ -76,7 +76,7 @@ function ldap_8859_to_t61($value) {}
* @param string $value
* @return string
*/
function ldap_t61_to_8859($value) {}
function ldap_t61_to_8859(string $value) {}
/**
* Connect to an LDAP server
@ -101,7 +101,7 @@ function ldap_t61_to_8859($value) {}
* If no arguments are specified then the link identifier of the already
* opened link will be returned.
*/
function ldap_connect ($uri = null, $port = 389) {}
function ldap_connect (string $uri, int $port = 389) {}
/**
* Alias of <b>ldap_unbind</b>
@ -120,7 +120,7 @@ function ldap_close ($ldap) {}
* @param string $password [optional]
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_bind ($ldap, $dn = null, $password = null) {}
function ldap_bind ($ldap, string $dn, string $password) {}
/**
* Bind to LDAP directory
@ -135,7 +135,7 @@ function ldap_bind ($ldap, $dn = null, $password = null) {}
* @return resource|false
* @since 7.3
*/
function ldap_bind_ext ($ldap, $dn = null, $password = null, $controls = []) {}
function ldap_bind_ext ($ldap, string $dn, string $password, array $controls = []) {}
/**
@ -169,10 +169,10 @@ function ldap_unbind ($ldap) {}
* @param resource $ldap <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param string $base <p>
* @param array|array|string $base <p>
* The base DN for the directory.
* </p>
* @param string $filter <p>
* @param array|string $filter <p>
* An empty filter is not allowed. If you want to retrieve absolutely all
* information for this entry, use a filter of
* objectClass=*. If you know which entry types are
@ -225,7 +225,7 @@ function ldap_unbind ($ldap) {}
* @param array $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, $base, $filter, array $attributes = null, $attributes_only = null, $sizelimit = null, $timelimit = null, $deref = null, $controls = []) {}
function ldap_read ($ldap, array|string $base, array|string $filter, array $attributes, int $attributes_only, int $sizelimit, int $timelimit, int $deref, array $controls = []) {}
/**
* Single-level search
@ -233,10 +233,10 @@ function ldap_read ($ldap, $base, $filter, array $attributes = null, $attributes
* @param resource $ldap <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param string $base <p>
* @param array|array|string $base <p>
* The base DN for the directory.
* </p>
* @param string $filter
* @param array|string $filter
* @param array $attributes [optional] <p>
* An array of the required attributes, e.g. array("mail", "sn", "cn").
* Note that the "dn" is always returned irrespective of which attributes
@ -283,7 +283,7 @@ function ldap_read ($ldap, $base, $filter, array $attributes = null, $attributes
* @param array $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, $base, $filter, array $attributes = null, $attributes_only = null, $sizelimit = null, $timelimit = null, $deref = null, $controls = []) {}
function ldap_list ($ldap, array|string $base, array|string $filter, array $attributes, int $attributes_only, int $sizelimit, int $timelimit, int $deref, array $controls = []) {}
/**
* Search LDAP tree
@ -291,10 +291,10 @@ function ldap_list ($ldap, $base, $filter, array $attributes = null, $attributes
* @param resource $ldap <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param string $base <p>
* @param array|string $base <p>
* The base DN for the directory.
* </p>
* @param string $filter <p>
* @param array|string $filter <p>
* The search filter can be simple or advanced, using boolean operators in
* the format described in the LDAP documentation (see the Netscape Directory SDK for full
* information on filters).
@ -345,7 +345,7 @@ function ldap_list ($ldap, $base, $filter, array $attributes = null, $attributes
* @param array $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, $base, $filter, array $attributes = null, $attributes_only = null, $sizelimit = null, $timelimit = null, $deref = null, $controls = []) {}
function ldap_search ($ldap, array|string $base, array|string $filter, array $attributes, int $attributes_only, int $sizelimit, int $timelimit, int $deref, array $controls = []) {}
/**
* Free result memory
@ -478,7 +478,7 @@ function ldap_get_attributes ($ldap, $entry) {}
* return_value[0] = first value of attribute
* return_value[i] = ith value of attribute
*/
function ldap_get_values ($ldap, $entry, $attribute) {}
function ldap_get_values ($ldap, $entry, string $attribute) {}
/**
* Get all binary values from a result entry
@ -493,7 +493,7 @@ function ldap_get_values ($ldap, $entry, $attribute) {}
* first index is 0. The number of values can be found by indexing "count"
* in the resultant array.
*/
function ldap_get_values_len ($ldap, $entry, $attribute) {}
function ldap_get_values_len ($ldap, $entry, string $attribute) {}
/**
* Get the DN of a result entry
@ -523,7 +523,7 @@ function ldap_get_dn ($ldap, $entry) {}
* represents the number of returned values, next elements are numerically
* indexed DN components.
*/
function ldap_explode_dn ($dn, $with_attrib) {}
function ldap_explode_dn (string $dn, int $with_attrib) {}
/**
* Convert DN to User Friendly Naming format
@ -533,7 +533,7 @@ function ldap_explode_dn ($dn, $with_attrib) {}
* </p>
* @return string the user friendly name.
*/
function ldap_dn2ufn ($dn) {}
function ldap_dn2ufn (string $dn) {}
/**
* Add entries to LDAP directory
@ -558,7 +558,7 @@ function ldap_dn2ufn ($dn) {}
* @param array $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, $dn, array $entry, $controls = []) {}
function ldap_add ($ldap, string $dn, array $entry, array $controls = []) {}
/**
* Add entries to LDAP directory
@ -585,7 +585,7 @@ function ldap_add ($ldap, $dn, array $entry, $controls = []) {}
* @return resource|false
* @since 7.4
*/
function ldap_add_ext ($ldap, $dn, array $entry, $controls = []) {}
function ldap_add_ext ($ldap, string $dn, array $entry, array $controls = []) {}
/**
* Delete an entry from a directory
@ -599,7 +599,7 @@ function ldap_add_ext ($ldap, $dn, array $entry, $controls = []) {}
* @param array $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, $dn, $controls = []) {}
function ldap_delete ($ldap, string $dn, array $controls = []) {}
/**
* Delete an entry from a directory
@ -615,7 +615,7 @@ function ldap_delete ($ldap, $dn, $controls = []) {}
* @return resource|false
* @since 7.3
*/
function ldap_delete_ext ($ldap, $dn, $controls = []) {}
function ldap_delete_ext ($ldap, string $dn, array $controls = []) {}
/**
* This function is an alias of: ldap_mod_replace().
@ -632,7 +632,7 @@ function ldap_delete_ext ($ldap, $dn, $controls = []) {}
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
* @since 7.0
*/
function ldap_modify ($ldap, $dn, array $entry, $controls = []) {}
function ldap_modify ($ldap, string $dn, array $entry, array $controls = []) {}
/**
* Add attribute values to current attributes
@ -647,7 +647,7 @@ function ldap_modify ($ldap, $dn, array $entry, $controls = []) {}
* @param array $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, $dn, array $entry, $controls = []) {}
function ldap_mod_add ($ldap, string $dn, array $entry, array $controls = []) {}
/**
* Add attribute values to current attributes
@ -663,7 +663,7 @@ function ldap_mod_add ($ldap, $dn, array $entry, $controls = []) {}
* @param array $controls [optional] Array of LDAP Controls to send with the request.
* @return resource|false
*/
function ldap_mod_add_ext ($ldap, $dn, array $entry, $controls = []) {}
function ldap_mod_add_ext ($ldap, string $dn, array $entry, array $controls = []) {}
/**
* Replace attribute values with new ones
@ -678,7 +678,7 @@ function ldap_mod_add_ext ($ldap, $dn, array $entry, $controls = []) {}
* @param array $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, $dn, array $entry, $controls = []) {}
function ldap_mod_replace ($ldap, string $dn, array $entry, array $controls = []) {}
/**
* Replace attribute values with new ones
@ -695,7 +695,7 @@ function ldap_mod_replace ($ldap, $dn, array $entry, $controls = []) {}
* @return resource|false
* @since 7.3
*/
function ldap_mod_replace_ext ($ldap, $dn, array $entry, $controls = []) {}
function ldap_mod_replace_ext ($ldap, string $dn, array $entry, array $controls = []) {}
/**
* Delete attribute values from current attributes
@ -710,7 +710,7 @@ function ldap_mod_replace_ext ($ldap, $dn, array $entry, $controls = []) {}
* @param array $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, $dn, array $entry, $controls = []) {}
function ldap_mod_del ($ldap, string $dn, array $entry, array $controls = []) {}
/**
* Delete attribute values from current attributes
@ -727,7 +727,7 @@ function ldap_mod_del ($ldap, $dn, array $entry, $controls = []) {}
* @return resource|false
* @since 7.3
*/
function ldap_mod_del_ext ($ldap, $dn, array $entry, $controls = []) {}
function ldap_mod_del_ext ($ldap, string $dn, array $entry, array $controls = []) {}
/**
* Return the LDAP error number of the last LDAP command
@ -748,7 +748,7 @@ function ldap_errno ($ldap) {}
* </p>
* @return string the error message, as a string.
*/
function ldap_err2str ($errno) {}
function ldap_err2str (int $errno) {}
/**
* Return the LDAP error message of the last LDAP command
@ -779,7 +779,7 @@ function ldap_error ($ldap) {}
* @return mixed <b>TRUE</b> if <i>value</i> matches otherwise returns
* <b>FALSE</b>. Returns -1 on error.
*/
function ldap_compare ($ldap, $dn, $attribute, $value, $controls = []) {}
function ldap_compare ($ldap, string $dn, string $attribute, string $value, array $controls = []) {}
/**
* Sort LDAP result entries
@ -798,7 +798,7 @@ function ldap_compare ($ldap, $dn, $attribute, $value, $controls = []) {}
* @return bool
*/
#[Deprecated(since: "7.0")]
function ldap_sort ($ldap, $result, $sortfilter) {}
function ldap_sort ($ldap, $result, string $sortfilter) {}
/**
* Modify the name of an entry
@ -822,7 +822,7 @@ function ldap_sort ($ldap, $result, $sortfilter) {}
* @param array $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, $dn, $new_rdn, $new_parent, $delete_old_rdn, $controls = []) {}
function ldap_rename ($ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, array $controls = []) {}
/**
* Modify the name of an entry
@ -848,7 +848,7 @@ function ldap_rename ($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn, $contr
* @return resource|false
* @since 7.3
*/
function ldap_rename_ext ($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn, $controls = []) {}
function ldap_rename_ext ($ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, array $controls = []) {}
/**
* Get the current value for given option
@ -920,7 +920,7 @@ function ldap_rename_ext ($ldap, $dn, $new_rdn, $new_parent, $delete_old_rdn, $c
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_get_option ($ldap, $option, &$value) {}
function ldap_get_option ($ldap, int $option, &$value) {}
/**
* Set the value of the given option
@ -1021,7 +1021,7 @@ function ldap_get_option ($ldap, $option, &$value) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_set_option ($ldap, $option, $value) {}
function ldap_set_option ($ldap, int $option, $value) {}
/**
* Return first reference
@ -1049,7 +1049,7 @@ function ldap_next_reference ($ldap, $entry) {}
* @param array &$referrals
* @return bool
*/
function ldap_parse_reference ($ldap, $entry, array &$referrals) {}
function ldap_parse_reference ($ldap, $entry, &$referrals) {}
/**
* Extract information from result
@ -1063,7 +1063,7 @@ function ldap_parse_reference ($ldap, $entry, array &$referrals) {}
* @param array &$controls [optional] An array of LDAP Controls which have been sent with the response.
* @return bool
*/
function ldap_parse_result ($ldap, $result, &$error_code, &$matched_dn = null, &$error_message = null, array &$referrals = null, &$controls = []) {}
function ldap_parse_result ($ldap, $result, &$error_code, &$matched_dn, &$error_message, &$referrals, &$controls = []) {}
/**
* Start TLS
@ -1105,7 +1105,7 @@ function ldap_set_rebind_proc ($ldap, callable $callback) {}
* @removed 8.0
*/
#[Deprecated(since: "7.4")]
function ldap_control_paged_result ($ldap, $pagesize, $iscritical = false, $cookie = "") {}
function ldap_control_paged_result ($ldap, int $pagesize, $iscritical = false, $cookie = "") {}
/**
* Retrieve the LDAP pagination cookie
@ -1136,7 +1136,7 @@ function ldap_control_paged_result_response ($ldap, $result, &$cookie = null, &$
* @since 5.6
*/
function ldap_escape ($value, $ignore = "", $flags = 0) {}
function ldap_escape (string $value, string $ignore = "", int $flags = 0) {}
/**
* (PHP 5.4 &gt;= 5.4.26, PHP 5.5 &gt;= 5.5.10, PHP 5.6 &gt;= 5.6.0)
@ -1147,7 +1147,7 @@ function ldap_escape ($value, $ignore = "", $flags = 0) {}
* {@see ldap_connect()}.
* </p>
* @param string $dn <p>The distinguished name of an LDAP entity.</p>
* @param $modifications_info <p>An array that specifies the modifications to make. Each entry in this
* @param array $modifications_info <p>An array that specifies the modifications to make. Each entry in this
* array is an associative array with two or three keys:
* <em>attrib</em> maps to the name of the attribute to modify,
* <em>modtype</em> maps to the type of modification to perform,
@ -1217,7 +1217,7 @@ function ldap_escape ($value, $ignore = "", $flags = 0) {}
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
* @since 5.4
*/
function ldap_modify_batch ($ldap , string $dn , $modifications_info, $controls = []) {}
function ldap_modify_batch ($ldap , string $dn , array $modifications_info, array $controls = []) {}
/**
* @param resource $ldap

View File

@ -82,7 +82,7 @@ function libxml_set_streams_context ($context) {}
* @return bool This function returns the previous value of
* <i>use_errors</i>.
*/
function libxml_use_internal_errors ($use_errors = false) {}
function libxml_use_internal_errors (bool $use_errors = false) {}
/**
* Retrieve last error from libxml
@ -121,7 +121,7 @@ function libxml_get_errors () {}
* @since 5.2.11
*/
#[Deprecated(since: "8.0")]
function libxml_disable_entity_loader ($disable = true) {}
function libxml_disable_entity_loader (bool $disable = true) {}
/**
* Changes the default external entity loader

View File

@ -24,7 +24,7 @@ use JetBrains\PhpStorm\Pure;
* way specified by mode.
*/
#[Pure]
function mb_convert_case ($string, $mode, $encoding = null) {}
function mb_convert_case (string $string, int $mode, string $encoding) {}
/**
* Make a string uppercase
@ -36,7 +36,7 @@ function mb_convert_case ($string, $mode, $encoding = null) {}
* @return string str with all alphabetic characters converted to uppercase.
*/
#[Pure]
function mb_strtoupper ($string, $encoding = null) {}
function mb_strtoupper (string $string, string $encoding) {}
/**
* Make a string lowercase
@ -48,7 +48,7 @@ function mb_strtoupper ($string, $encoding = null) {}
* @return string str with all alphabetic characters converted to lowercase.
*/
#[Pure]
function mb_strtolower ($string, $encoding = null) {}
function mb_strtolower (string $string, string $encoding) {}
/**
* Set/Get current language
@ -72,7 +72,7 @@ function mb_strtolower ($string, $encoding = null) {}
* name as a string. If no language is set previously, it then returns
* false.
*/
function mb_language ($language = null) {}
function mb_language (string $language) {}
/**
* Set/Get internal character encoding
@ -88,7 +88,7 @@ function mb_language ($language = null) {}
* If encoding is omitted, then
* the current character encoding name is returned.
*/
function mb_internal_encoding ($encoding = null) {}
function mb_internal_encoding (string $encoding) {}
/**
* Detect HTTP input character encoding
@ -104,7 +104,7 @@ function mb_internal_encoding ($encoding = null) {}
* HTTP input, it returns false.
*/
#[Pure]
function mb_http_input ($type = null) {}
function mb_http_input (string $type) {}
/**
* Set/Get HTTP output character encoding
@ -124,12 +124,12 @@ function mb_http_input ($type = null) {}
* character encoding. Otherwise,
* true on success or false on failure.
*/
function mb_http_output ($encoding = null) {}
function mb_http_output (string $encoding) {}
/**
* Set/Get character encoding detection order
* @link https://php.net/manual/en/function.mb-detect-order.php
* @param mixed $encoding [optional] <p>
* @param array|string|null $encoding [optional] <p>
* encoding_list is an array or
* comma separated list of character encoding. ("auto" is expanded to
* "ASCII, JIS, UTF-8, EUC-JP, SJIS")
@ -169,7 +169,7 @@ function mb_http_output ($encoding = null) {}
* When getting the encoding detection order, an ordered array
* of the encodings is returned.
*/
function mb_detect_order ($encoding = null) {}
function mb_detect_order (array|string $encoding = null) {}
/**
* Set/Get substitution character
@ -185,7 +185,7 @@ function mb_detect_order ($encoding = null) {}
* If substchar is not set, it returns the Unicode value,
* or "none" or "long".
*/
function mb_substitute_character ($substitute_character = null) {}
function mb_substitute_character (string|int $substitute_character = null) {}
#[PhpStormStubsElementAvailable(to: '7.4')]
/**
@ -199,7 +199,8 @@ function mb_substitute_character ($substitute_character = null) {}
* </p>
* @return bool true on success or false on failure.
*/
function mb_parse_str ($string, array &$result = null) {}
function mb_parse_str (string $string, &$result)
{}
#[PhpStormStubsElementAvailable('8.0')]
/**
@ -213,7 +214,7 @@ function mb_parse_str ($string, array &$result = null) {}
* </p>
* @return bool true on success or false on failure.
*/
function mb_parse_str ($string, array &$result) {}
function mb_parse_str (string $string, &$result) {}
/**
* Callback function converts character encoding in output buffer
@ -227,7 +228,7 @@ function mb_parse_str ($string, array &$result) {}
* @return string The converted string.
*/
#[Pure]
function mb_output_handler ($string, $status) {}
function mb_output_handler (string $string, int $status) {}
/**
* Get MIME charset string
@ -239,7 +240,7 @@ function mb_output_handler ($string, $status) {}
* encoding.
*/
#[Pure]
function mb_preferred_mime_name ($encoding) {}
function mb_preferred_mime_name (string $encoding) {}
/**
* Get string length
@ -254,7 +255,7 @@ function mb_preferred_mime_name ($encoding) {}
* counted as 1.
*/
#[Pure]
function mb_strlen ($string, $encoding = null) {}
function mb_strlen (string $string, string $encoding) {}
/**
* Find position of first occurrence of string in a string
@ -275,7 +276,7 @@ function mb_strlen ($string, $encoding = null) {}
* needle is not found, it returns false.
*/
#[Pure]
function mb_strpos ($haystack, $needle, $offset = 0, $encoding = null) {}
function mb_strpos (string $haystack, string $needle, int $offset = 0, string $encoding) {}
/**
* Find position of last occurrence of a string in a string
@ -297,7 +298,7 @@ function mb_strpos ($haystack, $needle, $offset = 0, $encoding = null) {}
* needle is not found, it returns false.
*/
#[Pure]
function mb_strrpos ($haystack, $needle, $offset = 0, $encoding = null) {}
function mb_strrpos (string $haystack, string $needle, int $offset = 0, string $encoding) {}
/**
* Finds position of first occurrence of a string within another, case insensitive
@ -322,7 +323,8 @@ function mb_strrpos ($haystack, $needle, $offset = 0, $encoding = null) {}
* string, or false if needle is not found.
*/
#[Pure]
function mb_stripos ($haystack, $needle, $offset = 0, $encoding = null) {}
function mb_stripos (string $haystack, string $needle, int $offset = 0, string $encoding)
{}
/**
* Finds position of last occurrence of a string within another, case insensitive
@ -348,7 +350,8 @@ function mb_stripos ($haystack, $needle, $offset = 0, $encoding = null) {}
* if needle is not found.
*/
#[Pure]
function mb_strripos ($haystack, $needle, $offset = 0, $encoding = null) {}
function mb_strripos (string $haystack, string $needle, int $offset = 0, string $encoding)
{}
/**
* Finds first occurrence of a string within another
@ -376,7 +379,8 @@ function mb_strripos ($haystack, $needle, $offset = 0, $encoding = null) {}
* or false if needle is not found.
*/
#[Pure]
function mb_strstr ($haystack, $needle, $before_needle = false, $encoding = null) {}
function mb_strstr (string $haystack, string $needle, bool $before_needle = false, string $encoding)
{}
/**
* Finds the last occurrence of a character in a string within another
@ -404,7 +408,8 @@ function mb_strstr ($haystack, $needle, $before_needle = false, $encoding = null
* or false if needle is not found.
*/
#[Pure]
function mb_strrchr ($haystack, $needle, $before_needle = false, $encoding = null) {}
function mb_strrchr (string $haystack, string $needle, bool $before_needle = false, string $encoding)
{}
/**
* Finds first occurrence of a string within another, case insensitive
@ -432,7 +437,8 @@ function mb_strrchr ($haystack, $needle, $before_needle = false, $encoding = nul
* or false if needle is not found.
*/
#[Pure]
function mb_stristr ($haystack, $needle, $before_needle = false, $encoding = null) {}
function mb_stristr (string $haystack, string $needle, bool $before_needle = false, string $encoding)
{}
/**
* Finds the last occurrence of a character in a string within another, case insensitive
@ -460,7 +466,8 @@ function mb_stristr ($haystack, $needle, $before_needle = false, $encoding = nul
* or false if needle is not found.
*/
#[Pure]
function mb_strrichr ($haystack, $needle, $before_needle = false, $encoding = null) {}
function mb_strrichr (string $haystack, string $needle, bool $before_needle = false, string $encoding)
{}
/**
* Count the number of substring occurrences
@ -477,7 +484,7 @@ function mb_strrichr ($haystack, $needle, $before_needle = false, $encoding = nu
* haystack string.
*/
#[Pure]
function mb_substr_count ($haystack, $needle, $encoding = null) {}
function mb_substr_count (string $haystack, string $needle, string $encoding) {}
/**
* Get part of string
@ -498,7 +505,8 @@ function mb_substr_count ($haystack, $needle, $encoding = null) {}
* length parameters.
*/
#[Pure]
function mb_substr ($string, $start, $length = null, $encoding = null) {}
function mb_substr (string $string, int $start, int $length, string $encoding)
{}
/**
* Get part of string
@ -519,7 +527,8 @@ function mb_substr ($string, $start, $length = null, $encoding = null) {}
* length parameters.
*/
#[Pure]
function mb_strcut ($string, $start, $length = null, $encoding = null) {}
function mb_strcut (string $string, int $start, int $length, string $encoding)
{}
/**
* Return width of string
@ -531,7 +540,7 @@ function mb_strcut ($string, $start, $length = null, $encoding = null) {}
* @return int The width of string str.
*/
#[Pure]
function mb_strwidth ($string, $encoding = null) {}
function mb_strwidth (string $string, string $encoding) {}
/**
* Get truncated string with specified width
@ -555,7 +564,8 @@ function mb_strwidth ($string, $encoding = null) {}
* trimmarker is appended to the return value.
*/
#[Pure]
function mb_strimwidth ($string, $start, $width, $trim_marker = null, $encoding = null) {}
function mb_strimwidth (string $string, int $start, int $width, string $trim_marker, string $encoding)
{}
/**
* Convert character encoding
@ -579,7 +589,8 @@ function mb_strimwidth ($string, $start, $width, $trim_marker = null, $encoding
* @return string The encoded string.
*/
#[Pure]
function mb_convert_encoding ($string, $to_encoding, $from_encoding = null) {}
function mb_convert_encoding (array|string $string, string $to_encoding, array|string $from_encoding = null)
{}
/**
* Detect character encoding
@ -605,7 +616,8 @@ function mb_convert_encoding ($string, $to_encoding, $from_encoding = null) {}
* detected from the given string.
*/
#[Pure]
function mb_detect_encoding ($string, $encodings = null, $strict = false) {}
function mb_detect_encoding (string $string, array|string $encodings = null, bool $strict = false)
{}
/**
* Returns an array of all supported encodings
@ -622,7 +634,7 @@ function mb_list_encodings () {}
* @link https://php.net/manual/en/function.mb-encoding-aliases.php
*/
#[Pure]
function mb_encoding_aliases ($encoding) {}
function mb_encoding_aliases (string $encoding) {}
/**
* Convert "kana" one from another ("zen-kaku", "han-kaku" and more)
@ -739,7 +751,8 @@ function mb_encoding_aliases ($encoding) {}
* @return string The converted string.
*/
#[Pure]
function mb_convert_kana ($string, $mode = null, $encoding = null) {}
function mb_convert_kana (string $string, string $mode, string $encoding)
{}
/**
* Encode string for MIME header
@ -774,7 +787,7 @@ function mb_convert_kana ($string, $mode = null, $encoding = null) {}
* @return string A converted version of the string represented in ASCII.
*/
#[Pure]
function mb_encode_mimeheader ($string, $charset = null, $transfer_encoding = null, $newline = null, $indent = null) {}
function mb_encode_mimeheader (string $string, string $charset, string $transfer_encoding, string $newline, int $indent) {}
/**
* Decode string in MIME header field
@ -785,7 +798,7 @@ function mb_encode_mimeheader ($string, $charset = null, $transfer_encoding = nu
* @return string The decoded string in internal character encoding.
*/
#[Pure]
function mb_decode_mimeheader ($string) {}
function mb_decode_mimeheader (string $string) {}
/**
* Convert character code in variable(s)
@ -809,7 +822,7 @@ function mb_decode_mimeheader ($string) {}
* @return string|false The character encoding before conversion for success,
* or false for failure.
*/
function mb_convert_variables ($to_encoding, $from_encoding, &$var, &...$vars) {}
function mb_convert_variables (string $to_encoding, array|string $from_encoding, mixed &$var, mixed &...$vars) {}
/**
* Encode character to HTML numeric string reference
@ -826,7 +839,7 @@ function mb_convert_variables ($to_encoding, $from_encoding, &$var, &...$vars) {
* @return string|false|null The converted string.
*/
#[Pure]
function mb_encode_numericentity ($string, array $map, $encoding = null, $hex = false) {}
function mb_encode_numericentity (string $string, array $map, string $encoding, bool $hex = false) {}
#[PhpStormStubsElementAvailable(to: '7.4')]
/**
@ -846,7 +859,7 @@ function mb_encode_numericentity ($string, array $map, $encoding = null, $hex =
* @return string|false|null The converted string.
*/
#[Pure]
function mb_decode_numericentity ($string, array $map, $encoding = null, $is_hex = false) {}
function mb_decode_numericentity ($string, array $map, string $encoding, $is_hex = false) {}
#[PhpStormStubsElementAvailable('8.0')]
/**
@ -863,7 +876,7 @@ function mb_decode_numericentity ($string, array $map, $encoding = null, $is_hex
* @return string|false|null The converted string.
*/
#[Pure]
function mb_decode_numericentity ($string, array $map, $encoding = null) {}
function mb_decode_numericentity ($string, array $map, string $encoding) {}
/**
* Send encoded mail
@ -894,7 +907,8 @@ function mb_decode_numericentity ($string, array $map, $encoding = null) {}
* </p>
* @return bool true on success or false on failure.
*/
function mb_send_mail ($to, $subject, $message, $additional_headers = null, $additional_params = null) {}
function mb_send_mail (string $to, string $subject, string $message, array|string $additional_headers, string $additional_params)
{}
/**
* Get internal settings of mbstring
@ -914,7 +928,7 @@ function mb_send_mail ($to, $subject, $message, $additional_headers = null, $add
* is not specified, otherwise a specific type.
*/
#[Pure]
function mb_get_info ($type = null) {}
function mb_get_info (string $type) {}
/**
* Check if the string is valid for the specified encoding
@ -930,7 +944,7 @@ function mb_get_info ($type = null) {}
* @since 5.1.3
*/
#[Pure]
function mb_check_encoding ($value = null, $encoding = null) {}
function mb_check_encoding (array|string $value = null, string $encoding) {}
/**
* Returns current encoding for multibyte regex as string
@ -941,7 +955,7 @@ function mb_check_encoding ($value = null, $encoding = null) {}
* is NOT changed. If encoding is omitted, then the current character
* encoding name for a multibyte regex is returned.
*/
function mb_regex_encoding ($encoding = null) {}
function mb_regex_encoding (string $encoding) {}
/**
* Set/Get the default options for mbregex functions
@ -952,7 +966,7 @@ function mb_regex_encoding ($encoding = null) {}
* @return string The previous options. If options is omitted,
* it returns the string that describes the current options.
*/
function mb_regex_set_options ($options = null) {}
function mb_regex_set_options (string $options) {}
/**
* Regular expression match with multibyte support
@ -968,7 +982,7 @@ function mb_regex_set_options ($options = null) {}
* </p>
* @return int
*/
function mb_ereg ($pattern, $string, array &$matches = null) {}
function mb_ereg (string $pattern, string $string, &$matches) {}
/**
* Regular expression match ignoring case with multibyte support
@ -984,7 +998,7 @@ function mb_ereg ($pattern, $string, array &$matches = null) {}
* </p>
* @return int
*/
function mb_eregi ($pattern, $string, array &$matches = null) {}
function mb_eregi (string $pattern, string $string, &$matches) {}
/**
* Replace regular expression with multibyte support
@ -1015,7 +1029,7 @@ function mb_eregi ($pattern, $string, array &$matches = null) {}
* @return string|false The resultant string on success, or false on error.
*/
#[Pure]
function mb_ereg_replace ($pattern, $replacement, $string, $options = "msr") {}
function mb_ereg_replace (string $pattern, string $replacement, string $string, string $options = "msr") {}
/**
* Perform a regular expresssion seach and replace with multibyte support using a callback
@ -1060,7 +1074,7 @@ function mb_ereg_replace ($pattern, $replacement, $string, $options = "msr") {}
* </p>
* @since 5.4.1
*/
function mb_ereg_replace_callback ($pattern, callable $callback, $string, $options = "msr") {}
function mb_ereg_replace_callback (string $pattern, callable $callback, string $string, string $options = "msr") {}
/**
* Replace regular expression with multibyte support ignoring case
@ -1080,7 +1094,7 @@ function mb_ereg_replace_callback ($pattern, callable $callback, $string, $optio
* @return string|false The resultant string or false on error.
*/
#[Pure]
function mb_eregi_replace ($pattern, $replacement, $string, $options = "msr") {}
function mb_eregi_replace (string $pattern, string $replacement, string $string, string $options = "msr") {}
/**
* Split multibyte string using regular expression
@ -1097,7 +1111,8 @@ function mb_eregi_replace ($pattern, $replacement, $string, $options = "msr") {}
* @return string[] The result as an array.
*/
#[Pure]
function mb_split ($pattern, $string, $limit = null) {}
function mb_split (string $pattern, string $string, int $limit)
{}
/**
* Regular expression match for multibyte string
@ -1113,7 +1128,8 @@ function mb_split ($pattern, $string, $limit = null) {}
* @return bool
*/
#[Pure]
function mb_ereg_match ($pattern, $string, $options = null) {}
function mb_ereg_match (string $pattern, string $string, string $options)
{}
/**
* Multibyte regular expression match for predefined multibyte string
@ -1127,7 +1143,7 @@ function mb_ereg_match ($pattern, $string, $options = null) {}
* @return bool
*/
#[Pure]
function mb_ereg_search ($pattern = null, $options = null) {}
function mb_ereg_search (string $pattern, string $options) {}
/**
* Returns position and length of a matched part of the multibyte regular expression for a predefined multibyte string
@ -1144,7 +1160,7 @@ function mb_ereg_search ($pattern = null, $options = null) {}
* length in bytes of the match. If an error occurs, FALSE is returned.
*/
#[Pure]
function mb_ereg_search_pos ($pattern = null, $options = null) {}
function mb_ereg_search_pos (string $pattern, string $options) {}
/**
* Returns the matched part of a multibyte regular expression
@ -1162,7 +1178,7 @@ function mb_ereg_search_pos ($pattern = null, $options = null) {}
* part as third element, and so on. It returns FALSE on error.
*/
#[Pure]
function mb_ereg_search_regs ($pattern = null, $options = null) {}
function mb_ereg_search_regs (string $pattern, string $options) {}
/**
* Setup string and regular expression for a multibyte regular expression match
@ -1178,7 +1194,8 @@ function mb_ereg_search_regs ($pattern = null, $options = null) {}
* </p>
* @return bool
*/
function mb_ereg_search_init ($string, $pattern = null, $options = null) {}
function mb_ereg_search_init (string $string, string $pattern, string $options)
{}
/**
* Retrieve the result from the last multibyte regular expression match
@ -1211,7 +1228,7 @@ function mb_ereg_search_getpos () {}
* @return bool
*/
#[Pure]
function mb_ereg_search_setpos ($offset) {}
function mb_ereg_search_setpos (int $offset) {}
/**
* @param $encoding [optional]
@ -1229,7 +1246,7 @@ function mbregex_encoding ($encoding) {}
* @removed 8.0
*/
#[Deprecated(replacement: 'mb_ereg(%parametersList%)',since: '7.3')]
function mbereg ($pattern, $string, &$registers) {}
function mbereg (string $pattern, string $string, array &$registers) {}
/**
* @param string $pattern
@ -1239,7 +1256,7 @@ function mbereg ($pattern, $string, &$registers) {}
* @removed 8.0
*/
#[Deprecated(replacement: "mb_eregi(%parametersList%)", since: "7.3")]
function mberegi ($pattern, $string, &$registers) {}
function mberegi (string $pattern, string $string, array &$registers) {}
/**
* @param $pattern
@ -1344,7 +1361,7 @@ function mbereg_search_getpos () {}
* @since 7.2
*/
#[Pure]
function mb_chr ($codepoint, $encoding = null) {}
function mb_chr (int $codepoint, string $encoding) {}
/**
* Get code point of character
@ -1355,7 +1372,7 @@ function mb_chr ($codepoint, $encoding = null) {}
* @since 7.2
*/
#[Pure]
function mb_ord ($string, $encoding = null) {}
function mb_ord (string $string, string $encoding) {}
/**
* Scrub broken multibyte strings.
@ -1366,7 +1383,7 @@ function mb_ord ($string, $encoding = null) {}
* @since 7.2
*/
#[Pure]
function mb_scrub ($string, $encoding = null) {}
function mb_scrub (string $string, string $encoding) {}
/**
* @param $position
@ -1393,7 +1410,8 @@ function mbereg_search_setpos ($position) {}
* @since 7.4
*/
#[Pure]
function mb_str_split ($string, $length = 1, $encoding = null) {}
function mb_str_split (string $string, int $length = 1, string $encoding)
{}
/**
* @removed 8.0

View File

@ -1475,7 +1475,7 @@ class mysqli_stmt {
* Zero indicates that no records where updated for an UPDATE statement,
* no rows matched the WHERE clause in the query or that no query has yet been executed. -1 indicates that the query returned an error.
*/
function mysqli_affected_rows ($mysql) {}
function mysqli_affected_rows (mysqli $mysql) {}
/**
* Turns on or off auto-committing database modifications
@ -1484,7 +1484,7 @@ function mysqli_affected_rows ($mysql) {}
* @param bool $enable Whether to turn on auto-commit or not.
* @return bool
*/
function mysqli_autocommit ($mysql, $enable) {}
function mysqli_autocommit (mysqli $mysql, bool $enable) {}
/**
* Starts a transaction
@ -1495,7 +1495,7 @@ function mysqli_autocommit ($mysql, $enable) {}
* @return bool true on success or false on failure.
* @since 5.5
*/
function mysqli_begin_transaction ($mysql, $flags = 0, $name = null) {}
function mysqli_begin_transaction (mysqli $mysql, int $flags = 0, string $name) {}
/**
* Changes the user of the specified database connection
@ -1503,10 +1503,10 @@ function mysqli_begin_transaction ($mysql, $flags = 0, $name = null) {}
* @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|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.
* @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.
* @return bool
*/
function mysqli_change_user ($mysql, $username, $password, $database) {}
function mysqli_change_user (mysqli $mysql, string $username, string $password, string $database) {}
/**
* Returns the default character set for the database connection
@ -1514,7 +1514,7 @@ function mysqli_change_user ($mysql, $username, $password, $database) {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return string The default character set for the current connection
*/
function mysqli_character_set_name ($mysql) {}
function mysqli_character_set_name (mysqli $mysql) {}
/**
* Closes a previously opened database connection
@ -1522,17 +1522,17 @@ function mysqli_character_set_name ($mysql) {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return bool
*/
function mysqli_close ($mysql) {}
function mysqli_close (mysqli $mysql) {}
/**
* Commits the current transaction
* @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 $name [optional] If provided then COMMITname is executed
* @return bool
*/
function mysqli_commit ($mysql, $flags = -1, $name = null) {}
function mysqli_commit (mysqli $mysql, int $flags = -1, string $name) {}
/**
* Open a new connection to the MySQL server
@ -1546,7 +1546,7 @@ function mysqli_commit ($mysql, $flags = -1, $name = null) {}
* @param string $socket Specifies the socket or named pipe that should be used.
* @return mysqli|false object which represents the connection to a MySQL Server or false if an error occurred.
*/
function mysqli_connect ($hostname = null, $username = null, $password = null, $database = null, $port = null, $socket = null) {}
function mysqli_connect (string $hostname, string $username, string $password, string $database, int $port, string $socket) {}
/**
* Returns the error code from last connect call
@ -1570,7 +1570,7 @@ function mysqli_connect_error () {}
* @param int $offset
* @return bool Returns TRUE on success or FALSE on failure.
*/
function mysqli_data_seek ($result, $offset) {}
function mysqli_data_seek (mysqli_result $result, int $offset) {}
/**
* Dump debugging information into the log
@ -1578,7 +1578,7 @@ function mysqli_data_seek ($result, $offset) {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return bool
*/
function mysqli_dump_debug_info ($mysql) {}
function mysqli_dump_debug_info (mysqli $mysql) {}
/**
* Performs debugging operations using the Fred Fish debugging library.
@ -1586,7 +1586,7 @@ function mysqli_dump_debug_info ($mysql) {}
* @param string $options
* @return bool
*/
function mysqli_debug ($options) {}
function mysqli_debug (string $options) {}
/**
* Returns the error code for the most recent function call
@ -1594,7 +1594,7 @@ function mysqli_debug ($options) {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return int An error code value for the last call, if it failed. zero means no error occurred.
*/
function mysqli_errno ($mysql) {}
function mysqli_errno (mysqli $mysql) {}
/**
* Returns a list of errors from the last command executed
@ -1603,7 +1603,7 @@ function mysqli_errno ($mysql) {}
* @return array A list of errors, each as an associative array containing the errno, error, and sqlstate.
* @since 5.4
*/
function mysqli_error_list ($mysql) {}
function mysqli_error_list (mysqli $mysql) {}
/**
* Returns a list of errors from the last statement executed
@ -1612,7 +1612,7 @@ function mysqli_error_list ($mysql) {}
* @return array A list of errors, each as an associative array containing the errno, error, and sqlstate.
* @since 5.4
*/
function mysqli_stmt_error_list ($statement) {}
function mysqli_stmt_error_list (mysqli_stmt $statement) {}
/**
* Returns a string description of the last error
@ -1620,7 +1620,7 @@ function mysqli_stmt_error_list ($statement) {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return string
*/
function mysqli_error ($mysql) {}
function mysqli_error (mysqli $mysql) {}
/**
* Executes a prepared Query
@ -1628,7 +1628,7 @@ function mysqli_error ($mysql) {}
* @param mysqli_stmt $statement
* @return bool
*/
function mysqli_stmt_execute ($statement) {}
function mysqli_stmt_execute (mysqli_stmt $statement) {}
/**
* Executes a prepared Query
@ -1637,7 +1637,7 @@ function mysqli_stmt_execute ($statement) {}
* @param mysqli_stmt $statement
*/
#[Deprecated(since: '5.3')]
function mysqli_execute ($statement) {}
function mysqli_execute (mysqli_stmt $statement) {}
/**
* Returns the next field in the result set
@ -1646,7 +1646,7 @@ function mysqli_execute ($statement) {}
* mysqli_store_result() or mysqli_use_result().
* @return object|false Returns an object which contains field definition information or FALSE if no field information is available.
*/
function mysqli_fetch_field ($result) {}
function mysqli_fetch_field (mysqli_result $result) {}
/**
* Returns an array of objects representing the fields in a result set
@ -1655,7 +1655,7 @@ function mysqli_fetch_field ($result) {}
* mysqli_store_result() or mysqli_use_result().
* @return array|false Returns an array of objects which contains field definition information or FALSE if no field information is available.
*/
function mysqli_fetch_fields ($result) {}
function mysqli_fetch_fields (mysqli_result $result) {}
/**
* Fetch meta-data for a single field
@ -1665,7 +1665,7 @@ function mysqli_fetch_fields ($result) {}
* @param int $index The field number. This value must be in the range from 0 to number of fields - 1.
* @return object|false Returns an object which contains field definition information or FALSE if no field information for specified fieldnr is available.
*/
function mysqli_fetch_field_direct ($result, $index) {}
function mysqli_fetch_field_direct (mysqli_result $result, int $index) {}
/**
* Returns the lengths of the columns of the current row in the result set
@ -1674,7 +1674,7 @@ function mysqli_fetch_field_direct ($result, $index) {}
* mysqli_store_result() or mysqli_use_result().
* @return int[]|false An array of integers representing the size of each column (not including any terminating null characters). FALSE if an error occurred.
*/
function mysqli_fetch_lengths ($result) {}
function mysqli_fetch_lengths (mysqli_result $result) {}
/**
* Fetches all result rows as an associative array, a numeric array, or both.
@ -1685,7 +1685,7 @@ function mysqli_fetch_lengths ($result) {}
* @param int $mode
* @return array Returns an array of associative or numeric arrays holding result rows.
*/
function mysqli_fetch_all ($result, $mode = MYSQLI_NUM) {}
function mysqli_fetch_all (mysqli_result $result, int $mode = MYSQLI_NUM) {}
/**
* Fetch a result row as an associative, a numeric array, or both.
@ -1695,7 +1695,7 @@ function mysqli_fetch_all ($result, $mode = MYSQLI_NUM) {}
* @param int $mode
* @return array|null
*/
function mysqli_fetch_array ($result, $mode = MYSQLI_BOTH) {}
function mysqli_fetch_array (mysqli_result $result, int $mode = MYSQLI_BOTH) {}
/**
* Fetch a result row as an associative array
@ -1708,7 +1708,7 @@ function mysqli_fetch_array ($result, $mode = MYSQLI_BOTH) {}
* 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 ($result) {}
function mysqli_fetch_assoc (mysqli_result $result) {}
/**
* Returns the current row of a result set as an object.
@ -1716,24 +1716,24 @@ function mysqli_fetch_assoc ($result) {}
* @param mysqli_result $result A result set identifier returned by mysqli_query(),
* 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 An optional array of parameters to pass to the constructor for class_name objects.
* @param array|null $constructor_args [optional] An optional array of parameters to pass to the constructor for class_name objects.
* @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 ($result, $class = 'stdClass', $constructor_args = null) {}
function mysqli_fetch_object (mysqli_result $result, string $class = 'stdClass', array $constructor_args) {}
/**
* 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().
* @link https://php.net/manual/en/mysqli-result.fetch-row.php
* @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 ($result) {}
function mysqli_fetch_row (mysqli_result $result) {}
/**
* Returns the number of columns for the most recent query
@ -1741,7 +1741,7 @@ function mysqli_fetch_row ($result) {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return int An integer representing the number of fields in a result set.
*/
function mysqli_field_count ($mysql) {}
function mysqli_field_count (mysqli $mysql) {}
/**
* Set result pointer to a specified field offset
@ -1751,7 +1751,7 @@ function mysqli_field_count ($mysql) {}
* @param int $index The field number. This value must be in the range from 0 to number of fields - 1.
* @return bool
*/
function mysqli_field_seek ($result, $index) {}
function mysqli_field_seek (mysqli_result $result, int $index) {}
/**
* Get current field offset of a result pointer
@ -1760,7 +1760,7 @@ function mysqli_field_seek ($result, $index) {}
* mysqli_store_result() or mysqli_use_result().
* @return int
*/
function mysqli_field_tell ($result) {}
function mysqli_field_tell (mysqli_result $result) {}
/**
* Frees the memory associated with a result
@ -1769,7 +1769,7 @@ function mysqli_field_tell ($result) {}
* mysqli_store_result() or mysqli_use_result().
* @return void
*/
function mysqli_free_result ($result) {}
function mysqli_free_result (mysqli_result $result) {}
/**
* Returns client Zval cache statistics
@ -1779,7 +1779,7 @@ function mysqli_free_result ($result) {}
* @return array|false an array with client Zval cache stats if success, false otherwise.
* @removed 5.4
*/
function mysqli_get_cache_stats ($mysql) {}
function mysqli_get_cache_stats (mysqli $mysql) {}
/**
* Returns statistics about the client connection
@ -1787,7 +1787,7 @@ function mysqli_get_cache_stats ($mysql) {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return array|false an array with connection stats if successful, FALSE otherwise.
*/
function mysqli_get_connection_stats ($mysql) {}
function mysqli_get_connection_stats (mysqli $mysql) {}
/**
* Returns client per-process statistics
@ -1802,7 +1802,7 @@ function mysqli_get_client_stats () {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return object
*/
function mysqli_get_charset ($mysql) {}
function mysqli_get_charset (mysqli $mysql) {}
/**
* Get MySQL client info
@ -1810,7 +1810,7 @@ function mysqli_get_charset ($mysql) {}
* @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
*/
function mysqli_get_client_info ($mysql = null) {}
function mysqli_get_client_info (mysqli $mysql) {}
/**
* Returns the MySQL client version as an integer
@ -1825,7 +1825,7 @@ function mysqli_get_client_version () {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return string A character string representing the server hostname and the connection type.
*/
function mysqli_get_host_info ($mysql) {}
function mysqli_get_host_info (mysqli $mysql) {}
/**
* Return information about open and cached links
@ -1877,7 +1877,7 @@ function mysqli_get_links_stats() {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return int Returns an integer representing the protocol version
*/
function mysqli_get_proto_info ($mysql) {}
function mysqli_get_proto_info (mysqli $mysql) {}
/**
* Returns the version of the MySQL server
@ -1885,7 +1885,7 @@ function mysqli_get_proto_info ($mysql) {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return string A character string representing the server version.
*/
function mysqli_get_server_info ($mysql) {}
function mysqli_get_server_info (mysqli $mysql) {}
/**
* Returns the version of the MySQL server as an integer
@ -1894,7 +1894,7 @@ function mysqli_get_server_info ($mysql) {}
* @return int An integer representing the server version.
* The form of this version number is main_version * 10000 + minor_version * 100 + sub_version (i.e. version 4.1.0 is 40100).
*/
function mysqli_get_server_version ($mysql) {}
function mysqli_get_server_version (mysqli $mysql) {}
/**
* Get result of SHOW WARNINGS
@ -1902,7 +1902,7 @@ function mysqli_get_server_version ($mysql) {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return mysqli_warning
*/
function mysqli_get_warnings ($mysql) {}
function mysqli_get_warnings (mysqli $mysql) {}
/**
* Initializes MySQLi and returns a resource for use with mysqli_real_connect()
@ -1918,7 +1918,7 @@ function mysqli_init () {}
* @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.
*/
function mysqli_info ($mysql) {}
function mysqli_info (mysqli $mysql) {}
/**
* Returns the auto generated id used in the last query
@ -1927,7 +1927,7 @@ function mysqli_info ($mysql) {}
* @return int|string The value of the AUTO_INCREMENT field that was updated by the previous query. Returns zero if there was no previous query on the connection or if the query did not update an AUTO_INCREMENT value.
* If the number is greater than maximal int value, mysqli_insert_id() will return a string.
*/
function mysqli_insert_id ($mysql) {}
function mysqli_insert_id (mysqli $mysql) {}
/**
* Asks the server to kill a MySQL thread
@ -1937,7 +1937,7 @@ function mysqli_insert_id ($mysql) {}
* @param int $process_id
* @return bool
*/
function mysqli_kill ($mysql, $process_id) {}
function mysqli_kill (mysqli $mysql, int $process_id) {}
/**
* Unsets user defined handler for load local infile command
@ -1945,7 +1945,7 @@ function mysqli_kill ($mysql, $process_id) {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return void
*/
function mysqli_set_local_infile_default ($mysql) {}
function mysqli_set_local_infile_default (mysqli $mysql) {}
/**
* Set callback function for LOAD DATA LOCAL INFILE command
@ -1954,7 +1954,7 @@ function mysqli_set_local_infile_default ($mysql) {}
* @param callable $read_func
* @return bool
*/
function mysqli_set_local_infile_handler ($mysql, $read_func) {}
function mysqli_set_local_infile_handler (mysqli $mysql, callable $read_func) {}
/**
* Check if there are any more query results from a multi query
@ -1963,7 +1963,7 @@ function mysqli_set_local_infile_handler ($mysql, $read_func) {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return bool
*/
function mysqli_more_results ($mysql) {}
function mysqli_more_results (mysqli $mysql) {}
/**
* Performs a query on the database
@ -1972,7 +1972,7 @@ function mysqli_more_results ($mysql) {}
* @param string $query One or more queries which are separated by semicolons.
* @return bool Returns FALSE if the first statement failed. To retrieve subsequent errors from other statements you have to call mysqli_next_result() first.
*/
function mysqli_multi_query ($mysql, $query) {}
function mysqli_multi_query (mysqli $mysql, string $query) {}
/**
* Prepare next result from multi_query
@ -1980,7 +1980,7 @@ function mysqli_multi_query ($mysql, $query) {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return bool
*/
function mysqli_next_result ($mysql) {}
function mysqli_next_result (mysqli $mysql) {}
/**
* Get the number of fields in a result
@ -1989,7 +1989,7 @@ function mysqli_next_result ($mysql) {}
* mysqli_store_result() or mysqli_use_result().
* @return int
*/
function mysqli_num_fields ($result) {}
function mysqli_num_fields (mysqli_result $result) {}
/**
* Gets the number of rows in a result
@ -1998,7 +1998,7 @@ function mysqli_num_fields ($result) {}
* mysqli_store_result() or mysqli_use_result().
* @return int Returns number of rows in the result set.
*/
function mysqli_num_rows ($result) {}
function mysqli_num_rows (mysqli_result $result) {}
/**
* Set options
@ -2008,7 +2008,7 @@ function mysqli_num_rows ($result) {}
* @param mixed $value
* @return bool
*/
function mysqli_options ($mysql, $option, $value) {}
function mysqli_options (mysqli $mysql, int $option, $value) {}
/**
* Pings a server connection, or tries to reconnect if the connection has gone down
@ -2016,7 +2016,7 @@ function mysqli_options ($mysql, $option, $value) {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return bool
*/
function mysqli_ping ($mysql) {}
function mysqli_ping (mysqli $mysql) {}
/**
* Poll connections
@ -2028,7 +2028,7 @@ function mysqli_ping ($mysql) {}
* @param int $microseconds [optional]
* @return int|false number of ready connections upon success, FALSE otherwise.
*/
function mysqli_poll (array &$read = null, array &$write = null, &$error = null, $seconds, $microseconds = 0) {}
function mysqli_poll (array &$read, array &$write, array &$error, int $seconds, int $microseconds = 0) {}
/**
* Prepare an SQL statement for execution
@ -2037,7 +2037,7 @@ function mysqli_poll (array &$read = null, array &$write = null, &$error = null,
* @param string $query
* @return mysqli_stmt|false A statement object or FALSE if an error occurred.
*/
function mysqli_prepare ($mysql, $query) {}
function mysqli_prepare (mysqli $mysql, string $query) {}
/**
* Enables or disables internal report functions
@ -2076,7 +2076,7 @@ function mysqli_prepare ($mysql, $query) {}
* </p>
* @return bool
*/
function mysqli_report ($flags) {}
function mysqli_report (int $flags) {}
/**
* Performs a query on the database
@ -2089,7 +2089,7 @@ function mysqli_report ($flags) {}
* For other successful queries mysqli_query() will return TRUE.
* Returns FALSE on failure.
*/
function mysqli_query ($mysql, $query, $result_mode = MYSQLI_STORE_RESULT) {}
function mysqli_query (mysqli $mysql, string $query, int $result_mode = MYSQLI_STORE_RESULT) {}
/**
* Opens a connection to a mysql server
@ -2105,7 +2105,7 @@ function mysqli_query ($mysql, $query, $result_mode = MYSQLI_STORE_RESULT) {}
* @param int $flags [optional]
* @return bool
*/
function mysqli_real_connect ($mysql, $hostname = null, $username = null, $password = null, $database = null, $port = null, $socket = null, $flags = null) {}
function mysqli_real_connect (mysqli $mysql, string $hostname, string $username, string $password, string $database, int $port, string $socket, int $flags) {}
/**
* Escapes special characters in a string for use in an SQL statement, taking into account the current charset of the connection
@ -2114,7 +2114,7 @@ function mysqli_real_connect ($mysql, $hostname = null, $username = null, $passw
* @param string $string The string to be escaped. Characters encoded are NUL (ASCII 0), \n, \r, \, ', ", and Control-Z.
* @return string
*/
function mysqli_real_escape_string ($mysql, $string) {}
function mysqli_real_escape_string (mysqli $mysql, string $string) {}
/**
* Execute an SQL query
@ -2124,7 +2124,7 @@ function mysqli_real_escape_string ($mysql, $string) {}
* @param string $query
* @return bool
*/
function mysqli_real_query ($mysql, $query) {}
function mysqli_real_query (mysqli $mysql, string $query) {}
/**
* Get result from async query
@ -2134,7 +2134,7 @@ function mysqli_real_query ($mysql, $query) {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return mysqli_result|false mysqli_result in success, FALSE otherwise.
*/
function mysqli_reap_async_query ($mysql) {}
function mysqli_reap_async_query (mysqli $mysql) {}
/**
* Removes the named savepoint from the set of savepoints of the current transaction
@ -2144,7 +2144,7 @@ function mysqli_reap_async_query ($mysql) {}
* @return bool Returns TRUE on success or FALSE on failure.
* @since 5.5
*/
function mysqli_release_savepoint ($mysql, $name) {}
function mysqli_release_savepoint (mysqli $mysql, string $name) {}
/**
* Rolls back current transaction
@ -2154,7 +2154,7 @@ function mysqli_release_savepoint ($mysql, $name) {}
* @param string $name [optional] If provided then ROLLBACKname is executed
* @return bool
*/
function mysqli_rollback ($mysql, $flags = 0, $name = null) {}
function mysqli_rollback (mysqli $mysql, int $flags = 0, string $name) {}
/**
* Set a named transaction savepoint
@ -2164,7 +2164,7 @@ function mysqli_rollback ($mysql, $flags = 0, $name = null) {}
* @return bool Returns TRUE on success or FALSE on failure.
* @since 5.5
*/
function mysqli_savepoint ($mysql, $name) {}
function mysqli_savepoint (mysqli $mysql, string $name) {}
/**
* Selects the default database for database queries
@ -2173,7 +2173,7 @@ function mysqli_savepoint ($mysql, $name) {}
* @param string $database
* @return bool
*/
function mysqli_select_db ($mysql, $database) {}
function mysqli_select_db (mysqli $mysql, string $database) {}
/**
* Sets the default client character set
@ -2182,7 +2182,7 @@ function mysqli_select_db ($mysql, $database) {}
* @param string $charset
* @return bool
*/
function mysqli_set_charset ($mysql, $charset) {}
function mysqli_set_charset (mysqli $mysql, string $charset) {}
/**
* Returns the total number of rows changed, deleted, or inserted by the last executed statement
@ -2190,7 +2190,7 @@ function mysqli_set_charset ($mysql, $charset) {}
* @param mysqli_stmt $statement
* @return int|string If the number of affected rows is greater than maximal PHP int value, the number of affected rows will be returned as a string value.
*/
function mysqli_stmt_affected_rows ($statement) {}
function mysqli_stmt_affected_rows (mysqli_stmt $statement) {}
/**
* Used to get the current value of a statement attribute
@ -2199,7 +2199,7 @@ function mysqli_stmt_affected_rows ($statement) {}
* @param int $attribute
* @return int|false Returns FALSE if the attribute is not found, otherwise returns the value of the attribute.
*/
function mysqli_stmt_attr_get ($statement, $attribute) {}
function mysqli_stmt_attr_get (mysqli_stmt $statement, int $attribute) {}
/**
* Used to modify the behavior of a prepared statement
@ -2209,7 +2209,7 @@ function mysqli_stmt_attr_get ($statement, $attribute) {}
* @param int $value
* @return bool
*/
function mysqli_stmt_attr_set ($statement, $attribute, $value) {}
function mysqli_stmt_attr_set (mysqli_stmt $statement, int $attribute, int $value) {}
/**
* Returns the number of fields in the given statement
@ -2217,7 +2217,7 @@ function mysqli_stmt_attr_set ($statement, $attribute, $value) {}
* @param mysqli_stmt $statement
* @return int
*/
function mysqli_stmt_field_count ($statement) {}
function mysqli_stmt_field_count (mysqli_stmt $statement) {}
/**
* Initializes a statement and returns an object for use with mysqli_stmt_prepare
@ -2225,7 +2225,7 @@ function mysqli_stmt_field_count ($statement) {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return mysqli_stmt
*/
function mysqli_stmt_init ($mysql) {}
function mysqli_stmt_init (mysqli $mysql) {}
/**
* Prepare an SQL statement for execution
@ -2234,7 +2234,7 @@ function mysqli_stmt_init ($mysql) {}
* @param string $query
* @return bool
*/
function mysqli_stmt_prepare ($statement, $query) {}
function mysqli_stmt_prepare (mysqli_stmt $statement, string $query) {}
/**
* Returns result set metadata from a prepared statement
@ -2242,7 +2242,7 @@ function mysqli_stmt_prepare ($statement, $query) {}
* @param mysqli_stmt $statement
* @return mysqli_result|false Returns a result object or FALSE if an error occurred
*/
function mysqli_stmt_result_metadata ($statement) {}
function mysqli_stmt_result_metadata (mysqli_stmt $statement) {}
/**
* Send data in blocks
@ -2252,7 +2252,7 @@ function mysqli_stmt_result_metadata ($statement) {}
* @param string $data
* @return bool
*/
function mysqli_stmt_send_long_data ($statement, $param_num, $data) {}
function mysqli_stmt_send_long_data (mysqli_stmt $statement, int $param_num, string $data) {}
/**
* Binds variables to a prepared statement as parameters
@ -2292,7 +2292,7 @@ function mysqli_stmt_send_long_data ($statement, $param_num, $data) {}
* @param mixed &...$_ [optional]
* @return bool true on success or false on failure.
*/
function mysqli_stmt_bind_param ($statement, $types, &$var1, &...$_) {}
function mysqli_stmt_bind_param (mysqli_stmt $statement, string $types, mixed &$var1, &...$_) {}
/**
* Binds variables to a prepared statement for result storage
@ -2302,7 +2302,7 @@ function mysqli_stmt_bind_param ($statement, $types, &$var1, &...$_) {}
* @param mixed &...$_ The variables to be bound.
* @return bool
*/
function mysqli_stmt_bind_result ($statement, &$var1, &...$_) {}
function mysqli_stmt_bind_result (mysqli_stmt $statement, mixed &$var1, &...$_) {}
/**
* Fetch results from a prepared statement into the bound variables
@ -2310,7 +2310,7 @@ function mysqli_stmt_bind_result ($statement, &$var1, &...$_) {}
* @param mysqli_stmt $statement
* @return bool|null
*/
function mysqli_stmt_fetch ($statement) {}
function mysqli_stmt_fetch (mysqli_stmt $statement) {}
/**
* Frees stored result memory for the given statement handle
@ -2318,7 +2318,7 @@ function mysqli_stmt_fetch ($statement) {}
* @param mysqli_stmt $statement
* @return void
*/
function mysqli_stmt_free_result ($statement) {}
function mysqli_stmt_free_result (mysqli_stmt $statement) {}
/**
* Gets a result set from a prepared statement
@ -2326,7 +2326,7 @@ function mysqli_stmt_free_result ($statement) {}
* @param mysqli_stmt $statement
* @return mysqli_result|false Returns a resultset or FALSE on failure.
*/
function mysqli_stmt_get_result ($statement) {}
function mysqli_stmt_get_result (mysqli_stmt $statement) {}
/**
* Get result of SHOW WARNINGS
@ -2334,7 +2334,7 @@ function mysqli_stmt_get_result ($statement) {}
* @param mysqli_stmt $statement
* @return object (not documented, but it's probably a mysqli_warning object)
*/
function mysqli_stmt_get_warnings ($statement) {}
function mysqli_stmt_get_warnings (mysqli_stmt $statement) {}
/**
* Get the ID generated from the previous INSERT operation
@ -2342,7 +2342,7 @@ function mysqli_stmt_get_warnings ($statement) {}
* @param mysqli_stmt $statement
* @return mixed
*/
function mysqli_stmt_insert_id ($statement) {}
function mysqli_stmt_insert_id (mysqli_stmt $statement) {}
/**
* Resets a prepared statement
@ -2350,7 +2350,7 @@ function mysqli_stmt_insert_id ($statement) {}
* @param mysqli_stmt $statement
* @return bool
*/
function mysqli_stmt_reset ($statement) {}
function mysqli_stmt_reset (mysqli_stmt $statement) {}
/**
* Returns the number of parameter for the given statement
@ -2358,7 +2358,7 @@ function mysqli_stmt_reset ($statement) {}
* @param mysqli_stmt $statement
* @return int
*/
function mysqli_stmt_param_count ($statement) {}
function mysqli_stmt_param_count (mysqli_stmt $statement) {}
/**
* Returns the SQLSTATE error from previous MySQL operation
@ -2366,7 +2366,7 @@ function mysqli_stmt_param_count ($statement) {}
* @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.
*/
function mysqli_sqlstate ($mysql) {}
function mysqli_sqlstate (mysqli $mysql) {}
/**
* Gets the current system status
@ -2374,7 +2374,7 @@ function mysqli_sqlstate ($mysql) {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return string|false A string describing the server status. FALSE if an error occurred.
*/
function mysqli_stat ($mysql) {}
function mysqli_stat (mysqli $mysql) {}
/**
* Used for establishing secure connections using SSL
@ -2387,7 +2387,7 @@ function mysqli_stat ($mysql) {}
* @param string $cipher_algos A list of allowable ciphers to use for SSL encryption
* @return bool This function always returns TRUE value.
*/
function mysqli_ssl_set($mysql, $key , $certificate , $ca_certificate , $ca_path , $cipher_algos) {}
function mysqli_ssl_set(mysqli $mysql, string $key , string $certificate , string $ca_certificate , string $ca_path , string $cipher_algos) {}
/**
* Closes a prepared statement
@ -2395,7 +2395,7 @@ function mysqli_ssl_set($mysql, $key , $certificate , $ca_certificate , $ca_path
* @param mysqli_stmt $statement
* @return bool
*/
function mysqli_stmt_close ($statement) {}
function mysqli_stmt_close (mysqli_stmt $statement) {}
/**
* Seeks to an arbitrary row in statement result set
@ -2404,7 +2404,7 @@ function mysqli_stmt_close ($statement) {}
* @param int $offset
* @return void
*/
function mysqli_stmt_data_seek ($statement, $offset) {}
function mysqli_stmt_data_seek (mysqli_stmt $statement, int $offset) {}
/**
* Returns the error code for the most recent statement call
@ -2412,7 +2412,7 @@ function mysqli_stmt_data_seek ($statement, $offset) {}
* @param mysqli_stmt $statement
* @return int
*/
function mysqli_stmt_errno ($statement) {}
function mysqli_stmt_errno (mysqli_stmt $statement) {}
/**
* Returns a string description for last statement error
@ -2420,7 +2420,7 @@ function mysqli_stmt_errno ($statement) {}
* @param mysqli_stmt $statement
* @return string
*/
function mysqli_stmt_error ($statement) {}
function mysqli_stmt_error (mysqli_stmt $statement) {}
/**
* Check if there are more query results from a multiple query
@ -2428,7 +2428,7 @@ function mysqli_stmt_error ($statement) {}
* @param mysqli_stmt $statement
* @return bool
*/
function mysqli_stmt_more_results ($statement) {}
function mysqli_stmt_more_results (mysqli_stmt $statement) {}
/**
* Reads the next result from a multiple query
@ -2436,7 +2436,7 @@ function mysqli_stmt_more_results ($statement) {}
* @param mysqli_stmt $statement
* @return bool
*/
function mysqli_stmt_next_result ($statement) {}
function mysqli_stmt_next_result (mysqli_stmt $statement) {}
/**
* Return the number of rows in statements result set
@ -2444,7 +2444,7 @@ function mysqli_stmt_next_result ($statement) {}
* @param mysqli_stmt $statement
* @return int
*/
function mysqli_stmt_num_rows ($statement) {}
function mysqli_stmt_num_rows (mysqli_stmt $statement) {}
/**
* Returns SQLSTATE error from previous statement operation
@ -2452,7 +2452,7 @@ function mysqli_stmt_num_rows ($statement) {}
* @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.
*/
function mysqli_stmt_sqlstate ($statement) {}
function mysqli_stmt_sqlstate (mysqli_stmt $statement) {}
/**
* Transfers a result set from a prepared statement
@ -2460,7 +2460,7 @@ function mysqli_stmt_sqlstate ($statement) {}
* @param mysqli_stmt $statement
* @return bool
*/
function mysqli_stmt_store_result ($statement) {}
function mysqli_stmt_store_result (mysqli_stmt $statement) {}
/**
* Transfers a result set from the last query
@ -2469,7 +2469,7 @@ function mysqli_stmt_store_result ($statement) {}
* @param int $mode [optional] The option that you want to set
* @return mysqli_result|false
*/
function mysqli_store_result ($mysql, int $mode = null) {}
function mysqli_store_result (mysqli $mysql, int $mode) {}
/**
* Returns the thread ID for the current connection
@ -2477,7 +2477,7 @@ function mysqli_store_result ($mysql, int $mode = null) {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return int Returns the Thread ID for the current connection.
*/
function mysqli_thread_id ($mysql) {}
function mysqli_thread_id (mysqli $mysql) {}
/**
* Returns whether thread safety is given or not
@ -2492,7 +2492,7 @@ function mysqli_thread_safe () {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return mysqli_result|false
*/
function mysqli_use_result ($mysql) {}
function mysqli_use_result (mysqli $mysql) {}
/**
* Returns the number of warnings from the last query for the given link
@ -2500,7 +2500,7 @@ function mysqli_use_result ($mysql) {}
* @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init()
* @return int
*/
function mysqli_warning_count ($mysql) {}
function mysqli_warning_count (mysqli $mysql) {}
/**
* Flushes tables or caches, or resets the replication server information
@ -2509,7 +2509,7 @@ function mysqli_warning_count ($mysql) {}
* @param int $flags
* @return bool
*/
function mysqli_refresh ($mysql, $flags) {}
function mysqli_refresh (mysqli $mysql, int $flags) {}
/**
* Alias for <b>mysqli_stmt_bind_param</b>
@ -2519,7 +2519,7 @@ function mysqli_refresh ($mysql, $flags) {}
* @removed 5.4
*/
#[Deprecated(since: '5.3')]
function mysqli_bind_param ($statement, $types) {}
function mysqli_bind_param (mysqli_stmt $statement, string $types) {}
/**
* Alias for <b>mysqli_stmt_bind_result</b>
@ -2530,7 +2530,7 @@ function mysqli_bind_param ($statement, $types) {}
* @removed 5.4
*/
#[Deprecated(since: '5.3')]
function mysqli_bind_result ($statement, $types, &$var1) {}
function mysqli_bind_result (mysqli_stmt $statement, string $types, mixed &$var1) {}
/**
* Alias of <b>mysqli_character_set_name</b>
@ -2540,7 +2540,7 @@ function mysqli_bind_result ($statement, $types, &$var1) {}
* @removed 5.4
*/
#[Deprecated(since: '5.3')]
function mysqli_client_encoding ($mysql) {}
function mysqli_client_encoding (mysqli $mysql) {}
/**
* Alias of <b>mysqli_real_escape_string</b>
@ -2549,7 +2549,7 @@ function mysqli_client_encoding ($mysql) {}
* @param string $string The string to be escaped
* @return string
*/
function mysqli_escape_string ($mysql, $string) {}
function mysqli_escape_string (mysqli $mysql, string $string) {}
/**
* Alias for <b>mysqli_stmt_fetch</b>
@ -2559,7 +2559,7 @@ function mysqli_escape_string ($mysql, $string) {}
* @removed 5.4
*/
#[Deprecated(since: '5.3')]
function mysqli_fetch ($statement) {}
function mysqli_fetch (mysqli_stmt $statement) {}
/**
* Alias for <b>mysqli_stmt_param_count</b>
@ -2569,7 +2569,7 @@ function mysqli_fetch ($statement) {}
* @removed 5.4
*/
#[Deprecated(since: '5.3')]
function mysqli_param_count ($statement) {}
function mysqli_param_count (mysqli_stmt $statement) {}
/**
* Alias for <b>mysqli_stmt_result_metadata</b>
@ -2579,7 +2579,7 @@ function mysqli_param_count ($statement) {}
* @removed 5.4
*/
#[Deprecated(since: '5.3')]
function mysqli_get_metadata ($statement) {}
function mysqli_get_metadata (mysqli_stmt $statement) {}
/**
* Alias for <b>mysqli_stmt_send_long_data</b>
@ -2591,7 +2591,7 @@ function mysqli_get_metadata ($statement) {}
* @removed 5.4
*/
#[Deprecated(since: '5.3')]
function mysqli_send_long_data ($statement, $param_num, $data) {}
function mysqli_send_long_data (mysqli_stmt $statement, int $param_num, string $data) {}
/**
* Alias of <b>mysqli_options</b>
@ -2601,7 +2601,7 @@ function mysqli_send_long_data ($statement, $param_num, $data) {}
* @param mixed $value
* @return bool
*/
function mysqli_set_opt ($mysql, $option, $value) {}
function mysqli_set_opt (mysqli $mysql, int $option, mixed $value) {}
/**

View File

@ -257,7 +257,7 @@ function openssl_x509_free($certificate) { }
* @return array|false The structure of the returned data is (deliberately) not
* yet documented, as it is still subject to change.
*/
function openssl_x509_parse($certificate, $short_names = true) { }
function openssl_x509_parse(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, $short_names = true) { }
/**
* Verifies if a certificate can be used for a particular purpose
@ -319,7 +319,7 @@ function openssl_x509_parse($certificate, $short_names = true) { }
* @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($certificate, $purpose, array $ca_info = null, $untrusted_certificates_file = null) { }
function openssl_x509_checkpurpose(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, $purpose, array $ca_info = null, $untrusted_certificates_file = null) { }
/**
* Checks if a private key corresponds to a certificate
@ -333,31 +333,31 @@ function openssl_x509_checkpurpose($certificate, $purpose, array $ca_info = null
* @return bool true if <i>key</i> is the private key that
* corresponds to <i>cert</i>, or false otherwise.
*/
function openssl_x509_check_private_key($certificate, $private_key) { }
function openssl_x509_check_private_key(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, $private_key) { }
/**
* Exports a certificate as a string
* @link https://php.net/manual/en/function.openssl-x509-export.php
* @param mixed $certificate
* @param OpenSSLCertificate|string|resource $certificate
* @param string &$output <p>
* On success, this will hold the PEM.
* </p>
* @param bool $no_text [optional] &note.openssl.param-notext;
* @return bool true on success or false on failure.
*/
function openssl_x509_export($certificate, &$output, $no_text = true) { }
function openssl_x509_export(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, &$output, $no_text = true) { }
/**
* Exports a certificate to file
* @link https://php.net/manual/en/function.openssl-x509-export-to-file.php
* @param mixed $certificate
* @param OpenSSLCertificate|string|resource $certificate
* @param string $output_filename <p>
* Path to the output file.
* </p>
* @param bool $no_text [optional] &note.openssl.param-notext;
* @return bool true on success or false on failure.
*/
function openssl_x509_export_to_file($certificate, $output_filename, $no_text = true) { }
function openssl_x509_export_to_file(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, $output_filename, $no_text = true) { }
/**
* Verifies digital signature of x509 certificate against a public key

View File

@ -93,7 +93,7 @@ function pcntl_fork () {}
* child which exited, -1 on error or zero if <b>WNOHANG</b> was used and no
* child was available
*/
function pcntl_waitpid ($process_id, &$status, $flags = 0, array &$resource_usage) {}
function pcntl_waitpid (int $process_id, &$status, int $flags = 0, &$resource_usage) {}
/**
* Waits on or returns the status of a forked child
@ -139,7 +139,7 @@ function pcntl_waitpid ($process_id, &$status, $flags = 0, array &$resource_usag
* child which exited, -1 on error or zero if WNOHANG was provided as an
* option (on wait3-available systems) and no child was available.
*/
function pcntl_wait (&$status, $flags = 0, &$resource_usage) {}
function pcntl_wait (&$status, int $flags = 0, &$resource_usage) {}
/**
* Installs a signal handler
@ -169,7 +169,7 @@ function pcntl_wait (&$status, $flags = 0, &$resource_usage) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function pcntl_signal ($signal, $handler, $restart_syscalls = true) {}
function pcntl_signal (int $signal, $handler, bool $restart_syscalls = true) {}
/**
* Calls signal handlers for pending signals
@ -188,7 +188,7 @@ function pcntl_signal_dispatch () {}
* otherwise.
*/
#[Pure]
function pcntl_wifexited ($status) {}
function pcntl_wifexited (int $status) {}
/**
* Checks whether the child process is currently stopped
@ -200,7 +200,7 @@ function pcntl_wifexited ($status) {}
* currently stopped, <b>FALSE</b> otherwise.
*/
#[Pure]
function pcntl_wifstopped ($status) {}
function pcntl_wifstopped (int $status) {}
/**
* Checks whether the status code represents a termination due to a signal
@ -212,7 +212,7 @@ function pcntl_wifstopped ($status) {}
* not caught, <b>FALSE</b> otherwise.
*/
#[Pure]
function pcntl_wifsignaled ($status) {}
function pcntl_wifsignaled (int $status) {}
/**
* Returns the return code of a terminated child
@ -223,14 +223,15 @@ function pcntl_wifsignaled ($status) {}
* @return int the return code, as an integer.
*/
#[Pure]
function pcntl_wexitstatus ($status) {}
function pcntl_wexitstatus (int $status) {}
/**
* @param int $status
* @return bool
*/
#[Pure]
function pcntl_wifcontinued ( $status){}
function pcntl_wifcontinued (int $status){}
/**
* Returns the signal which caused the child to terminate
* @link https://php.net/manual/en/function.pcntl-wtermsig.php
@ -240,7 +241,7 @@ function pcntl_wifcontinued ( $status){}
* @return int the signal number, as an integer.
*/
#[Pure]
function pcntl_wtermsig ($status) {}
function pcntl_wtermsig (int $status) {}
/**
* Returns the signal which caused the child to stop
@ -251,7 +252,7 @@ function pcntl_wtermsig ($status) {}
* @return int the signal number.
*/
#[Pure]
function pcntl_wstopsig ($status) {}
function pcntl_wstopsig (int $status) {}
/**
* Executes specified program in current process space
@ -274,7 +275,8 @@ function pcntl_wstopsig ($status) {}
* </p>
* @return void <b>FALSE</b> on error and does not return on success.
*/
function pcntl_exec ($path, array $args = null, array $env_vars = null) {}
function pcntl_exec (string $path, array $args, array $env_vars)
{}
/**
* Set an alarm clock for delivery of a signal
@ -287,7 +289,7 @@ function pcntl_exec ($path, array $args = null, array $env_vars = null) {}
* remaining before it was to be delivered, or 0 if there
* was no previously scheduled alarm.
*/
function pcntl_alarm ($seconds) {}
function pcntl_alarm (int $seconds) {}
/**
* Retrieve the error number set by the last pcntl function which failed
@ -316,7 +318,7 @@ function pcntl_errno () {}
* @since 5.3.4
*/
#[Pure]
function pcntl_strerror ($error_code) {}
function pcntl_strerror (int $error_code) {}
/**
* Get the priority of any process
@ -333,7 +335,7 @@ function pcntl_strerror ($error_code) {}
* scheduling.
*/
#[Pure]
function pcntl_getpriority ($process_id, $mode = PRIO_PROCESS) {}
function pcntl_getpriority (int $process_id, int $mode = PRIO_PROCESS) {}
/**
* Change the priority of any process
@ -355,7 +357,7 @@ function pcntl_getpriority ($process_id, $mode = PRIO_PROCESS) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function pcntl_setpriority ($priority, $process_id, $mode = PRIO_PROCESS) {}
function pcntl_setpriority (int $priority, int $process_id, int $mode = PRIO_PROCESS) {}
/**
* Sets and retrieves blocked signals
@ -379,7 +381,8 @@ function pcntl_setpriority ($priority, $process_id, $mode = PRIO_PROCESS) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function pcntl_sigprocmask ($mode, array $signals, array &$old_signals = null) {}
function pcntl_sigprocmask (int $mode, array $signals, &$old_signals)
{}
/**
* Waits for signals
@ -419,7 +422,7 @@ function pcntl_sigprocmask ($mode, array $signals, array &$old_signals = null) {
* </p>
* @return int On success, <b>pcntl_sigwaitinfo</b> returns a signal number.
*/
function pcntl_sigwaitinfo (array $signals, array &$info = null) {}
function pcntl_sigwaitinfo (array $signals, &$info) {}
/**
* Waits for signals, with a timeout
@ -440,7 +443,7 @@ function pcntl_sigwaitinfo (array $signals, array &$info = null) {}
* </p>
* @return int On success, <b>pcntl_sigtimedwait</b> returns a signal number.
*/
function pcntl_sigtimedwait (array $signals, array &$info = null, $seconds = 0, $nanoseconds = 0) {}
function pcntl_sigtimedwait (array $signals, &$info, int $seconds = 0, int $nanoseconds = 0) {}
/**
* Enable/disable asynchronous signal handling or return the old setting.<br>
@ -455,7 +458,7 @@ function pcntl_sigtimedwait (array $signals, array &$info = null, $seconds = 0,
* @return bool
* @since 7.1
*/
function pcntl_async_signals($enable = null) {}
function pcntl_async_signals(bool $enable) {}
/**
* Get the current handler for specified signal.
@ -469,14 +472,14 @@ function pcntl_async_signals($enable = null) {}
* @since 7.1
*/
function pcntl_signal_get_handler($signal) {}
function pcntl_signal_get_handler(int $signal) {}
/**
* @param int $flags
* @return bool
* @since 7.4
*/
function pcntl_unshare($flags){}
function pcntl_unshare(int $flags){}
define ('WNOHANG', 1);
define ('WUNTRACED', 2);

View File

@ -155,7 +155,7 @@ use JetBrains\PhpStorm\Pure;
* matches given <i>subject</i>, 0 if it does not, or <b>FALSE</b>
* if an error occurred.
*/
function preg_match ($pattern, $subject, array &$matches = null, $flags = 0, $offset = 0) {}
function preg_match (string $pattern, string $subject, &$matches, int $flags = 0, int $offset = 0) {}
/**
* Perform a global regular expression match
@ -215,7 +215,7 @@ function preg_match ($pattern, $subject, array &$matches = null, $flags = 0, $of
* @return int|false the number of full pattern matches (which might be zero),
* or <b>FALSE</b> if an error occurred.
*/
function preg_match_all ($pattern, $subject, array &$matches = null, $flags = PREG_PATTERN_ORDER, $offset = 0) {}
function preg_match_all (string $pattern, string $subject, &$matches, int $flags = PREG_PATTERN_ORDER, int $offset = 0) {}
/**
* Perform a regular expression search and replace
@ -303,7 +303,8 @@ function preg_match_all ($pattern, $subject, array &$matches = null, $flags = PR
* be returned, otherwise <i>subject</i> will be
* returned unchanged or <b>NULL</b> if an error occurred.
*/
function preg_replace ($pattern, $replacement, $subject, $limit = -1, &$count = null) {}
function preg_replace (array|string $pattern, array|string $replacement, array|string $subject, int $limit = -1, &$count)
{}
/**
* Perform a regular expression search and replace using a callback
@ -374,7 +375,8 @@ function preg_replace ($pattern, $replacement, $subject, $limit = -1, &$count =
* If matches are found, the new subject will be returned, otherwise
* <i>subject</i> will be returned unchanged.
*/
function preg_replace_callback ($pattern, callable $callback, $subject, $limit = -1, &$count = null, $flags = 0) {}
function preg_replace_callback (array|string $pattern, callable $callback, array|string $subject, int $limit = -1, &$count, int $flags = 0)
{}
/**
* Perform a regular expression search and replace using callbacks
@ -387,7 +389,7 @@ function preg_replace_callback ($pattern, callable $callback, $subject, $limit =
* @return string|string[]|null <p>preg_replace_callback_array() returns an array if the subject parameter is an array, or a string otherwise. On errors the return value is NULL</p>
* <p>If matches are found, the new subject will be returned, otherwise subject will be returned unchanged.</p>
*/
function preg_replace_callback_array ($pattern, $subject , $limit = -1, &$count = null, $flags = 0) {}
function preg_replace_callback_array (array $pattern, array|string $subject , int $limit = -1, &$count, int $flags = 0) {}
/**
* Perform a regular expression search and replace
@ -405,7 +407,7 @@ function preg_replace_callback_array ($pattern, $subject , $limit = -1, &$count
* is returned when <i>subject</i> is an array
* or <b>NULL</b> otherwise.
*/
function preg_filter ($pattern, $replacement, $subject, $limit = -1, &$count = null) {}
function preg_filter (array|string $pattern, array|string $replacement, array|string $subject, int $limit = -1, &$count) {}
/**
* Split string by a regular expression
@ -434,7 +436,7 @@ function preg_filter ($pattern, $replacement, $subject, $limit = -1, &$count = n
* if an error occurred.
*/
#[Pure]
function preg_split ($pattern, $subject, $limit = -1, $flags = 0) {}
function preg_split (string $pattern, string $subject, int $limit = -1, int $flags = 0) {}
/**
* Quote regular expression characters
@ -451,7 +453,8 @@ function preg_split ($pattern, $subject, $limit = -1, $flags = 0) {}
* @return string the quoted (escaped) string.
*/
#[Pure]
function preg_quote ($str, $delimiter = null) {}
function preg_quote (string $str, string $delimiter)
{}
/**
* Return array entries that match the pattern
@ -471,7 +474,7 @@ function preg_quote ($str, $delimiter = null) {}
* <i>input</i> array or false when pattern cannot be compiled.
*/
#[Pure]
function preg_grep ($pattern, array $array, $flags = 0) {}
function preg_grep (string $pattern, array $array, int $flags = 0) {}
/**
* Returns the error code of the last PCRE regex execution

View File

@ -14,7 +14,7 @@ use JetBrains\PhpStorm\Pure;
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function posix_kill ($process_id, $signal) {}
function posix_kill (int $process_id, int $signal) {}
/**
* Return the current process identifier
@ -48,7 +48,7 @@ function posix_getuid () {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function posix_setuid ($user_id) {}
function posix_setuid (int $user_id) {}
/**
* Return the effective user ID of the current process
@ -66,7 +66,7 @@ function posix_geteuid () {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function posix_seteuid ($user_id) {}
function posix_seteuid (int $user_id) {}
/**
* Set system resource limits
@ -81,7 +81,7 @@ function posix_seteuid ($user_id) {}
* @return bool Returns TRUE on success or FALSE on failure.
* @since 7.0
*/
function posix_setrlimit ($resource, $soft_limit, $hard_limit ) {}
function posix_setrlimit (int $resource, int $soft_limit, int $hard_limit) {}
/**
* Return the real group ID of the current process
* @link https://php.net/manual/en/function.posix-getgid.php
@ -98,7 +98,7 @@ function posix_getgid () {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function posix_setgid ($group_id) {}
function posix_setgid (int $group_id) {}
/**
* Return the effective group ID of the current process
@ -116,7 +116,7 @@ function posix_getegid () {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function posix_setegid ($group_id) {}
function posix_setegid (int $group_id) {}
/**
* Return the group set of the current process
@ -161,7 +161,7 @@ function posix_setsid () {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function posix_setpgid ($process_id, $process_group_id) {}
function posix_setpgid (int $process_id, int $process_group_id) {}
/**
* Get process group id for job control
@ -172,7 +172,7 @@ function posix_setpgid ($process_id, $process_group_id) {}
* @return int the identifier, as an integer.
*/
#[Pure]
function posix_getpgid ($process_id) {}
function posix_getpgid (int $process_id) {}
/**
* Get the current sid of the process
@ -186,7 +186,7 @@ function posix_getpgid ($process_id) {}
* @return int the identifier, as an integer.
*/
#[Pure]
function posix_getsid ($process_id) {}
function posix_getsid (int $process_id) {}
/**
* Get system name
@ -286,7 +286,7 @@ function posix_getcwd () {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function posix_mkfifo ($filename, $permissions) {}
function posix_mkfifo (string $filename, int $permissions) {}
/**
* Create a special or ordinary file (POSIX.1)
@ -310,7 +310,7 @@ function posix_mkfifo ($filename, $permissions) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function posix_mknod ($filename, $flags, $major = 0, $minor = 0) {}
function posix_mknod (string $filename, int $flags, int $major = 0, int $minor = 0) {}
/**
* Determine accessibility of a file
@ -332,7 +332,7 @@ function posix_mknod ($filename, $flags, $major = 0, $minor = 0) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function posix_access ($filename, $flags = POSIX_F_OK) {}
function posix_access (string $filename, int $flags = POSIX_F_OK) {}
/**
* Return info about a group by name
@ -379,7 +379,7 @@ function posix_access ($filename, $flags = POSIX_F_OK) {}
* </table>
*/
#[Pure]
function posix_getgrnam ($name) {}
function posix_getgrnam (string $name) {}
/**
* Return info about a group by group id
@ -428,7 +428,7 @@ function posix_getgrnam ($name) {}
* </table>
*/
#[Pure]
function posix_getgrgid ($group_id) {}
function posix_getgrgid (int $group_id) {}
/**
* Return info about a user by username
@ -505,7 +505,7 @@ function posix_getgrgid ($group_id) {}
* </table>
*/
#[Pure]
function posix_getpwnam ($username) {}
function posix_getpwnam (string $username) {}
/**
* Return info about a user by user id
@ -581,7 +581,7 @@ function posix_getpwnam ($username) {}
* </table>
*/
#[Pure]
function posix_getpwuid ($user_id) {}
function posix_getpwuid (int $user_id) {}
/**
* Return info about system resource limits
@ -695,7 +695,7 @@ function posix_errno () {}
* @return string the error message, as a string.
*/
#[Pure]
function posix_strerror ($error_code) {}
function posix_strerror (int $error_code) {}
/**
* Calculate the group access list
@ -709,7 +709,7 @@ function posix_strerror ($error_code) {}
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
#[Pure]
function posix_initgroups ($username, $group_id) {}
function posix_initgroups (string $username, int $group_id) {}
/**

View File

@ -11,7 +11,7 @@
* @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 ($prompt = null) {}
function readline (string $prompt) {}
/**
* Gets/sets various internal readline variables
@ -31,7 +31,7 @@ function readline ($prompt = null) {}
* <p>
* If called with one or two parameters, the old value is returned.
*/
function readline_info ($var_name = null, $value = null) {}
function readline_info (string $var_name, $value) {}
/**
* Adds a line to the history
@ -41,7 +41,7 @@ function readline_info ($var_name = null, $value = null) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function readline_add_history ($prompt) {}
function readline_add_history (string $prompt) {}
/**
* Clears the history
@ -66,7 +66,7 @@ function readline_list_history () {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function readline_read_history ($filename = null) {}
function readline_read_history (string $filename) {}
/**
* Writes the history
@ -76,7 +76,7 @@ function readline_read_history ($filename = null) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function readline_write_history ($filename = null) {}
function readline_write_history (string $filename) {}
/**
* Registers a completion function
@ -101,7 +101,7 @@ function readline_completion_function (callable $callback) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function readline_callback_handler_install ($prompt, callable $callback) {}
function readline_callback_handler_install (string $prompt, callable $callback) {}
/**
* Reads a character and informs the readline callback interface when a line is received

View File

@ -23,7 +23,7 @@ use JetBrains\PhpStorm\Deprecated;
* </p>
* @return string the name of the current session.
*/
function session_name ($name = null) {}
function session_name (string $name) {}
/**
* Get and/or set the current session module.<br/>
@ -35,7 +35,7 @@ function session_name ($name = null) {}
* </p>
* @return string the name of the current session module.
*/
function session_module_name ($module = null) {}
function session_module_name (string $module) {}
/**
* Get and/or set the current session save path
@ -54,7 +54,7 @@ function session_module_name ($module = null) {}
* </p>
* @return string the path of the current directory used for data storage.
*/
function session_save_path ($path = null) {}
function session_save_path (string $path) {}
/**
* Get and/or set the current session id
@ -75,7 +75,7 @@ function session_save_path ($path = null) {}
* session or the empty string ("") if there is no current
* session (no current session id exists).
*/
function session_id ($id = null) {}
function session_id (string $id) {}
/**
* Update the current session id with a newly generated one
@ -85,7 +85,7 @@ function session_id ($id = null) {}
* </p>
* @return bool true on success or false on failure.
*/
function session_regenerate_id ($delete_old_session = false) {}
function session_regenerate_id (bool $delete_old_session = false) {}
/**
* PHP > 5.4.0 <br/>
@ -103,7 +103,7 @@ function session_register_shutdown () {}
* </p>
* @return bool true on success or false on failure.
*/
function session_decode ($data) {}
function session_decode (string $data) {}
/**
* Register one or more global variables with the current session
@ -117,7 +117,7 @@ function session_decode ($data) {}
* @removed 5.4
*/
#[Deprecated(since: '5.3')]
function session_register ($name, ...$_) {}
function session_register (mixed $name, ...$_) {}
/**
* Unregister a global variable from the current session
@ -129,7 +129,7 @@ function session_register ($name, ...$_) {}
* @removed 5.4
*/
#[Deprecated(since: '5.3')]
function session_unregister ($name) {}
function session_unregister (string $name) {}
/**
* Find out whether a global variable is registered in a session
@ -143,7 +143,7 @@ function session_unregister ($name) {}
* @removed 5.4
*/
#[Deprecated(since: '5.3')]
function session_is_registered ($name) {}
function session_is_registered (string $name) {}
/**
* Encodes the current session data as a string
@ -160,7 +160,7 @@ function session_encode () {}
* @return bool This function returns true if a session was successfully started,
* otherwise false.
*/
function session_start ($options = []) {}
function session_start (array $options = []) {}
/**
* Create new session id
@ -172,7 +172,7 @@ function session_start ($options = []) {}
* If it is used without active session, it omits collision check.
* @since 7.1
*/
function session_create_id($prefix) {}
function session_create_id(string $prefix) {}
/**
* Perform session data garbage collection
@ -243,7 +243,8 @@ function session_unset () {}
* @param callback $update_timestamp [optional]
* @return bool true on success or false on failure.
*/
function session_set_save_handler ($open, $close, $read, $write, $destroy, $gc, $create_sid = null, $validate_sid = null, $update_timestamp = null) {}
function session_set_save_handler (callable $open, callable $close, callable $read, callable $write, callable $destroy, callable $gc, $create_sid, $validate_sid, $update_timestamp)
{}
/**
* (PHP 5.4)<br/>
@ -312,12 +313,12 @@ function session_set_save_handler (SessionHandlerInterface $session_handler, $re
* </table>
* @return string the name of the current cache limiter.
*/
function session_cache_limiter ($value = null) {}
function session_cache_limiter (string $value) {}
/**
* Return current cache expire
* @link https://php.net/manual/en/function.session-cache-expire.php
* @param string $value [optional] <p>
* @param int $value [optional] <p>
* If <i>new_cache_expire</i> is given, the current cache
* expire is replaced with <i>new_cache_expire</i>.
* </p>
@ -329,7 +330,7 @@ function session_cache_limiter ($value = null) {}
* @return int the current setting of session.cache_expire.
* The value returned should be read in minutes, defaults to 180.
*/
function session_cache_expire ($value = null) {}
function session_cache_expire (int $value) {}
/**
* Set the session cookie parameters
@ -346,13 +347,13 @@ function session_cache_expire ($value = null) {}
* @return bool returns true on success or false on failure.
* @since 7.3
*/
function session_set_cookie_params ($options) {}
function session_set_cookie_params (array $options) {}
/**
* Set the session cookie parameters
* @link https://php.net/manual/en/function.session-set-cookie-params.php
* @param int $lifetime_or_options <p>
* @param array|int $lifetime_or_options <p>
* Lifetime of the
* session cookie, defined in seconds.
* </p>
@ -377,7 +378,8 @@ function session_set_cookie_params ($options) {}
* </p>
* @return void|bool since 7.2.0 returns true on success or false on failure.
*/
function session_set_cookie_params ($lifetime_or_options, $path = null, $domain = null, $secure = false, $httponly = false) {}
function session_set_cookie_params (array|int $lifetime_or_options, string $path, string $domain, bool $secure = false, bool $httponly = false)
{}
/**
* Get the session cookie parameters

View File

@ -27,7 +27,7 @@ use JetBrains\PhpStorm\Deprecated;
* use to access the shared memory segment you've created. <b>FALSE</b> is
* returned on failure.
*/
function shmop_open ($key, $mode, $permissions, $size) {}
function shmop_open (int $key, string $mode, int $permissions, int $size) {}
/**
* Read data from shared memory block

View File

@ -906,7 +906,7 @@ class SoapHeader {
* </p>
* @return bool the original value.
*/
function use_soap_error_handler ($enable = true) {}
function use_soap_error_handler (bool $enable = true) {}
/**
* Checks if a SOAP call has failed
@ -916,7 +916,7 @@ function use_soap_error_handler ($enable = true) {}
* </p>
* @return bool This will return <b>TRUE</b> on error, and <b>FALSE</b> otherwise.
*/
function is_soap_fault ($object) {}
function is_soap_fault (mixed $object) {}
define ('SOAP_1_1', 1);
define ('SOAP_1_2', 2);

View File

@ -348,7 +348,7 @@ function sodium_crypto_stream_keygen(): string {}
* @throws SodiumException
* @since 7.2
*/
function sodium_pad ($string, $length): string {}
function sodium_pad (string $string, int $length): string {}
/**
* Remove padding data
@ -358,7 +358,7 @@ function sodium_pad ($string, $length): string {}
* @throws SodiumException
* @since 7.2
*/
function sodium_unpad ($string, $block_size): string {}
function sodium_unpad (string $string, int $block_size): string {}
@ -1154,7 +1154,7 @@ function sodium_crypto_secretstream_xchacha20poly1305_push(string &$state, strin
* @since 7.2
* @see https://www.php.net/manual/en/function.sodium-crypto-secretstream-xchacha20poly1305-init-pull.php
*/
function sodium_crypto_secretstream_xchacha20poly1305_init_pull($header, $key): string{}
function sodium_crypto_secretstream_xchacha20poly1305_init_pull(string $header, string $key): string{}
/**
* @throws SodiumException

View File

@ -7,7 +7,7 @@
* @since 7.0
* @throws Exception if it was not possible to gather sufficient entropy.
*/
function random_bytes ($length) {}
function random_bytes (int $length) {}
/**
* Generates cryptographically secure pseudo-random integers
@ -18,4 +18,4 @@ function random_bytes ($length) {}
* @since 7.0
* @throws Exception if it was not possible to gather sufficient entropy.
*/
function random_int ($min, $max) {}
function random_int (int $min, int $max) {}

View File

@ -32,11 +32,11 @@ define("__COMPILER_HALT_OFFSET__",0);
* @see unpack()
* @since 5.4
*/
function hex2bin($string) {};
function hex2bin(string $string) {};
/**
* Get or Set the HTTP response code
* @param int $response_code [optional] The optional response_code will set the response code.
* @return int The current response code. By default the return value is int(200).
*/
function http_response_code($response_code = null) {}
function http_response_code(int $response_code) {}

View File

@ -25,7 +25,7 @@ namespace {
* @param mixed ...$_ [optional] <p>Another variable ...</p>
* @return array the assigned array.
*/
function PS_UNRESERVE_PREFIX_list($var1, ...$_){};
function PS_UNRESERVE_PREFIX_list(mixed $var1, ...$_){};
/**
* <p>Terminates execution of the script. Shutdown functions and object destructors will always be executed even if exit is called.</p>
@ -90,7 +90,7 @@ namespace {
* </ul>
* </p>
*/
function PS_UNRESERVE_PREFIX_empty($var){};
function PS_UNRESERVE_PREFIX_empty(mixed $var){};
/**
* <p>Determine if a variable is set and is not <b>NULL</b>.</p>
@ -103,7 +103,7 @@ namespace {
* @param mixed ...$_ [optional] <p>Another variable ...</p>
* @return bool Returns <b>TRUE</b> if var exists and has value other than <b>NULL</b>, <b>FALSE</b> otherwise.
*/
function PS_UNRESERVE_PREFIX_isset($var, ...$_){};
function PS_UNRESERVE_PREFIX_isset(mixed $var, ...$_){};
/**
* <p>Destroys the specified variables.</p>
@ -113,7 +113,7 @@ namespace {
* @param mixed ...$_ [optional] <p>Another variable ...</p>
* @return void
*/
function PS_UNRESERVE_PREFIX_unset($var, ...$_){};
function PS_UNRESERVE_PREFIX_unset(mixed $var, ...$_){};
/**
* <p>Evaluates the given code as PHP.</p>
@ -145,7 +145,7 @@ namespace {
* case <b>eval()</b> returned <b>FALSE</b> and execution of the following code continued normally. It is not possible to catch a parse
* error in <b>eval()</b> using set_error_handler().
*/
function PS_UNRESERVE_PREFIX_eval($code){};
function PS_UNRESERVE_PREFIX_eval(string $code){};
/**
* Generator objects are returned from generators, cannot be instantiated via new.
@ -184,7 +184,7 @@ namespace {
* @param mixed $value
* @return mixed
*/
function send($value) {}
function send(mixed $value) {}
/**
* Throws an exception at the current suspension point in the generator.
@ -280,15 +280,15 @@ class object {
*/
public function __get(string $name) {}
/**
* run when writing data to inaccessible members.
*
* @param string $name
* @param mixed $value
* @return void
* @link https://php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members
*/
public function __set(string $name, $value): void {}
/**
* run when writing data to inaccessible members.
*
* @param string $name
* @param mixed $value
* @return void
* @link https://php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members
*/
public function __set(string $name, mixed $value): void {}
/**
* is triggered by calling isset() or empty() on inaccessible members.

View File

@ -38,7 +38,7 @@ use JetBrains\PhpStorm\Pure;
* @link https://php.net/manual/en/function.dl.php
*/
#[Deprecated(since: '5.3')]
function dl ($extension_filename) {}
function dl (string $extension_filename) {}
/**
* Sets the process title
@ -49,7 +49,7 @@ function dl ($extension_filename) {}
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
* @since 5.5
*/
function cli_set_process_title ($title) {}
function cli_set_process_title (string $title) {}
/**
* Returns the current process title
@ -68,7 +68,7 @@ function cli_get_process_title () {}
* @link https://php.net/manual/en/function.is-iterable.php
*/
#[Pure]
function is_iterable($value) {}
function is_iterable(mixed $value) {}
/**
* Encodes an ISO-8859-1 string to UTF-8
@ -79,7 +79,7 @@ function is_iterable($value) {}
* @return string the UTF-8 translation of <i>data</i>.
*/
#[Pure]
function utf8_encode ($string) {}
function utf8_encode (string $string) {}
/**
* Converts a string with ISO-8859-1 characters encoded with UTF-8
@ -91,7 +91,7 @@ function utf8_encode ($string) {}
* @return string the ISO-8859-1 translation of <i>data</i>.
*/
#[Pure]
function utf8_decode ($string) {}
function utf8_decode (string $string) {}
/**
* Clear the most recent error
@ -107,7 +107,7 @@ function error_clear_last () {}
* @return int
* @since 7.1
*/
function sapi_windows_cp_get($kind) {}
function sapi_windows_cp_get(string $kind) {}
/**
* Set process codepage
@ -115,7 +115,7 @@ function sapi_windows_cp_get($kind) {}
* @return bool
* @since 7.1
*/
function sapi_windows_cp_set($cp) {}
function sapi_windows_cp_set(int $cp) {}
/**
* Convert string from one codepage to another
@ -125,7 +125,7 @@ function sapi_windows_cp_set($cp) {}
* @return string
* @since 7.1
*/
function sapi_windows_cp_conv($in_codepage, $out_codepage, $subject) {}
function sapi_windows_cp_conv(int|string $in_codepage, int|string $out_codepage, string $subject) {}
/**
* Indicates whether the codepage is utf-8 compatible
@ -155,7 +155,7 @@ function sapi_windows_cp_is_utf8() {}
* If <i>enable</i> is specified: Returns TRUE on success or FALSE on failure.
* @since 7.2
*/
function sapi_windows_vt100_support ($stream, $enable) {}
function sapi_windows_vt100_support ($stream, bool $enable) {}
/**
* Set or remove a CTRL event handler.

View File

@ -161,7 +161,7 @@ define('PASSWORD_ARGON2_PROVIDER', 'standard');
* @since 5.5
*/
#[ArrayShape(["algo" => "int", "algoName" => "string", "options" => "array"])]
function password_get_info ($hash) {}
function password_get_info (string $hash) {}
/**
* (PHP 5 &gt;= 5.5.0, PHP 5)<br/>
@ -180,18 +180,18 @@ function password_get_info ($hash) {}
* @return string|false|null Returns the hashed password, or FALSE on failure, or null if the algorithm is invalid
* @since 5.5
*/
function password_hash ($password, $algo, $options = []) {}
function password_hash (string $password, string|int|null $algo, array $options = []) {}
/**
* Checks if the given hash matches the given options.
* @link https://secure.php.net/manual/en/function.password-needs-rehash.php
* @param string $hash A hash created by password_hash().
* @param int $algo A <a href="https://secure.php.net/manual/en/password.constants.php" class="link">password algorithm constant</a> denoting the algorithm to use when hashing the password.
* @param string|int $algo A <a href="https://secure.php.net/manual/en/password.constants.php" class="link">password algorithm constant</a> denoting the algorithm to use when hashing the password.
* @param array $options [optional] <p> An associative array containing options. See the password algorithm constants for documentation on the supported options for each algorithm.
* @return bool Returns TRUE if the hash should be rehashed to match the given algo and options, or FALSE otherwise.
* @since 5.5
*/
function password_needs_rehash ($hash, $algo, $options = []) {}
function password_needs_rehash (string $hash, string|int|null $algo, array $options = []) {}
/**
* Checks if the given hash matches the given options.
@ -201,7 +201,7 @@ function password_needs_rehash ($hash, $algo, $options = []) {}
* @return bool Returns TRUE if the password and hash match, or FALSE otherwise.
* @since 5.5
*/
function password_verify ($password, $hash) {}
function password_verify (string $password, string $hash) {}
/**
* Return a complete list of all registered password hashing algorithms.

View File

@ -58,7 +58,6 @@ class php_user_filter {
* The filter experienced an unrecoverable error and cannot continue.
* </td>
* </tr>
*
*/
public function filter($in, $out, &$consumed, $closing)
{
@ -133,7 +132,7 @@ class Directory {
* defined.
*/
#[Pure]
function constant ($name) {}
function constant (string $name) {}
/**
* Convert binary data into hexadecimal representation
@ -144,7 +143,7 @@ function constant ($name) {}
* @return string the hexadecimal representation of the given string.
*/
#[Pure]
function bin2hex ($string) {}
function bin2hex (string $string) {}
/**
* Delay execution
@ -156,7 +155,7 @@ function bin2hex ($string) {}
* by a signal, sleep returns the number of seconds left
* to sleep.
*/
function sleep ($seconds) {}
function sleep (int $seconds) {}
/**
* Delay execution in microseconds
@ -167,7 +166,7 @@ function sleep ($seconds) {}
* </p>
* @return void
*/
function usleep ($microseconds) {}
function usleep (int $microseconds) {}
/**
* Delay for a number of seconds and nanoseconds
@ -188,7 +187,7 @@ function usleep ($microseconds) {}
* nanoseconds - number of nanoseconds
* remaining in the delay
*/
function time_nanosleep ($seconds, $nanoseconds) {}
function time_nanosleep (int $seconds, int $nanoseconds) {}
/**
* Make the script sleep until the specified time
@ -198,7 +197,7 @@ function time_nanosleep ($seconds, $nanoseconds) {}
* </p>
* @return bool true on success or false on failure.
*/
function time_sleep_until ($timestamp) {}
function time_sleep_until (float $timestamp) {}
/**
* Parse a time/date generated with <function>strftime</function>
@ -263,7 +262,7 @@ function time_sleep_until ($timestamp) {}
* </table>
*/
#[Pure]
function strptime ($timestamp, $format) {}
function strptime (string $timestamp, string $format) {}
/**
* Flush the output buffer
@ -294,7 +293,7 @@ function flush () {}
* @return string the given string wrapped at the specified column.
*/
#[Pure]
function wordwrap ($string, $width = 75, $break = "\n", $cut_long_words = false) {}
function wordwrap (string $string, int $width = 75, string $break = "\n", bool $cut_long_words = false) {}
/**
* Convert special characters to HTML entities
@ -302,7 +301,7 @@ function wordwrap ($string, $width = 75, $break = "\n", $cut_long_words = false)
* @param string $string <p>
* The {@link https://secure.php.net/manual/en/language.types.string.php string} being converted.
* </p>
* @param int $flags [optional] <p>
* @param int|string $flags [optional] <p>
* A bitmask of one or more of the following flags, which specify how to handle quotes,
* invalid code unit sequences and the used document type. The default is
* <em><b>ENT_COMPAT | ENT_HTML401</b></em>.
@ -413,7 +412,8 @@ function wordwrap ($string, $width = 75, $break = "\n", $cut_long_words = false)
* @return string The converted string.
*/
#[Pure]
function htmlspecialchars ($string, $flags = ENT_COMPAT | ENT_HTML401, $encoding = 'UTF-8', $double_encode = true) {}
function htmlspecialchars (string $string, int $flags = ENT_COMPAT | ENT_HTML401, string $encoding = 'UTF-8', bool $double_encode = true)
{}
/**
* Convert all applicable characters to HTML entities
@ -460,7 +460,8 @@ function htmlspecialchars ($string, $flags = ENT_COMPAT | ENT_HTML401, $encoding
* @return string the encoded string.
*/
#[Pure]
function htmlentities ($string, $flags = null, $encoding = null, $double_encode = true) {}
function htmlentities (string $string, int $flags, string $encoding, bool $double_encode = true)
{}
/**
* Convert HTML entities to their corresponding characters
@ -502,7 +503,8 @@ function htmlentities ($string, $flags = null, $encoding = null, $double_encode
* @return string the decoded string.
*/
#[Pure]
function html_entity_decode ($string, $flags = null, $encoding = null) {}
function html_entity_decode (string $string, int $flags, string $encoding)
{}
/**
* Convert special HTML entities back to characters
@ -536,7 +538,8 @@ function html_entity_decode ($string, $flags = null, $encoding = null) {}
* @return string the decoded string.
*/
#[Pure]
function htmlspecialchars_decode ($string, $flags = null) {}
function htmlspecialchars_decode (string $string, int $flags)
{}
/**
* Returns the translation table used by <function>htmlspecialchars</function> and <function>htmlentities</function>
@ -714,7 +717,7 @@ function htmlspecialchars_decode ($string, $flags = null) {}
* @return array the translation table as an array.
*/
#[Pure]
function get_html_translation_table ($table = null, $flags = null, string $encoding = "UTF-8") {}
function get_html_translation_table (int $table, int $flags, string $encoding = "UTF-8") {}
/**
* Calculate the sha1 hash of a string
@ -731,7 +734,7 @@ function get_html_translation_table ($table = null, $flags = null, string $encod
* @return string the sha1 hash as a string.
*/
#[Pure]
function sha1 ($string, $binary = false) {}
function sha1 (string $string, bool $binary = false) {}
/**
* Calculate the sha1 hash of a file
@ -746,7 +749,7 @@ function sha1 ($string, $binary = false) {}
* @return string|false a string on success, false otherwise.
*/
#[Pure]
function sha1_file ($filename, $binary = false) {}
function sha1_file (string $filename, bool $binary = false) {}
/**
* Calculate the md5 hash of a string
@ -762,7 +765,7 @@ function sha1_file ($filename, $binary = false) {}
* @return string the hash as a 32-character hexadecimal number.
*/
#[Pure]
function md5 ($string, $binary = false) {}
function md5 (string $string, bool $binary = false) {}
/**
* Calculates the md5 hash of a given file
@ -777,7 +780,7 @@ function md5 ($string, $binary = false) {}
* @return string|false a string on success, false otherwise.
*/
#[Pure]
function md5_file ($filename, $binary = false) {}
function md5_file (string $filename, bool $binary = false) {}
/**
* Calculates the crc32 polynomial of a string
@ -788,7 +791,7 @@ function md5_file ($filename, $binary = false) {}
* @return int the crc32 checksum of str as an integer..1
*/
#[Pure]
function crc32 ($string) {}
function crc32 (string $string) {}
/**
* Parse a binary IPTC block into single tags.
@ -801,7 +804,7 @@ function crc32 ($string) {}
* value. It returns false on error or if no IPTC data was found.
*/
#[Pure]
function iptcparse ($iptc_block) {}
function iptcparse (string $iptc_block) {}
/**
* Embeds binary IPTC data into a JPEG image.
@ -820,7 +823,8 @@ function iptcparse ($iptc_block) {}
* @return string|bool If success and spool flag is lower than 2 then the JPEG will not be
* returned as a string, false on errors.
*/
function iptcembed ($iptc_data, $filename, $spool = null) {}
function iptcembed (string $iptc_data, string $filename, int $spool)
{}
/**
* Get the size of an image
@ -883,7 +887,8 @@ function iptcembed ($iptc_data, $filename, $spool = null) {}
* <p>
* On failure, false is returned.
*/
function getimagesize ($filename, array &$image_info = null) {}
function getimagesize (string $filename, &$image_info)
{}
/**
* Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype
@ -971,7 +976,7 @@ function getimagesize ($filename, array &$image_info = null) {}
* </table>
*/
#[Pure]
function image_type_to_mime_type ($image_type) {}
function image_type_to_mime_type (int $image_type) {}
/**
* Get file extension for image type
@ -986,7 +991,7 @@ function image_type_to_mime_type ($image_type) {}
* @return string A string with the extension corresponding to the given image type.
*/
#[Pure]
function image_type_to_extension ($image_type, $include_dot = true) {}
function image_type_to_extension (int $image_type, $include_dot = true) {}
/**
* Outputs information about PHP's configuration
@ -1072,7 +1077,7 @@ function image_type_to_extension ($image_type, $include_dot = true) {}
* </p>
* @return bool true on success or false on failure.
*/
function phpinfo ($flags = null) {}
function phpinfo (int $flags) {}
/**
* Gets the current PHP version
@ -1086,7 +1091,7 @@ function phpinfo ($flags = null) {}
* the extension isn't enabled.
*/
#[Pure]
function phpversion ($extension = null) {}
function phpversion (string $extension) {}
/**
* Prints out the credits for PHP
@ -1151,7 +1156,7 @@ function phpversion ($extension = null) {}
* </p>
* @return bool true on success or false on failure.
*/
function phpcredits ($flags = null) {}
function phpcredits (int $flags) {}
/**
* Gets the logo guid
@ -1211,7 +1216,7 @@ function php_sapi_name () {}
* @return string the description, as a string.
*/
#[Pure]
function php_uname ($mode = null) {}
function php_uname (string $mode) {}
/**
* Return a list of .ini files parsed from the additional ini dir
@ -1251,7 +1256,7 @@ function php_ini_loaded_file () {}
* str2, and 0 if they are equal.
*/
#[Pure]
function strnatcmp ($string1, $string2) {}
function strnatcmp (string $string1, string $string2) {}
/**
* Case insensitive string comparisons using a "natural order" algorithm
@ -1268,7 +1273,7 @@ function strnatcmp ($string1, $string2) {}
* str2, and 0 if they are equal.
*/
#[Pure]
function strnatcasecmp ($string1, $string2) {}
function strnatcasecmp (string $string1, string $string2) {}
/**
* Count the number of substring occurrences
@ -1290,7 +1295,8 @@ function strnatcasecmp ($string1, $string2) {}
* @return int This functions returns an integer.
*/
#[Pure]
function substr_count ($haystack, $needle, $offset = null, $length = null) {}
function substr_count (string $haystack, string $needle, int $offset, int $length)
{}
/**
* Finds the length of the initial segment of a string consisting
@ -1343,7 +1349,8 @@ function substr_count ($haystack, $needle, $offset = null, $length = null) {}
* which consists entirely of characters in str2.
*/
#[Pure]
function strspn ($string, $characters, $offset = null, $length = null) {}
function strspn (string $string, string $characters, int $offset, int $length)
{}
/**
* Find length of initial segment not matching mask
@ -1363,7 +1370,8 @@ function strspn ($string, $characters, $offset = null, $length = null) {}
* @return int the length of the segment as an integer.
*/
#[Pure]
function strcspn ($string, $characters, $offset = null, $length = null) {}
function strcspn (string $string, string $characters, int $offset, int $length)
{}
/**
* Tokenize string
@ -1381,4 +1389,5 @@ function strcspn ($string, $characters, $offset = null, $length = null) {}
* </p>
* @return string A string token.
*/
function strtok ($string = null, $token) {}
function strtok (string $string, string $token)
{}

View File

@ -14,7 +14,7 @@ use JetBrains\PhpStorm\Pure;
* @return string the uppercased string.
*/
#[Pure]
function strtoupper ($string) {}
function strtoupper (string $string) {}
/**
* Make a string lowercase
@ -25,7 +25,7 @@ function strtoupper ($string) {}
* @return string the lowercased string.
*/
#[Pure]
function strtolower ($string) {}
function strtolower (string $string) {}
/**
* Find the position of the first occurrence of a substring in a string
@ -33,7 +33,7 @@ function strtolower ($string) {}
* @param string $haystack <p>
* The string to search in
* </p>
* @param mixed $needle <p>
* @param string $needle <p>
* If <b>needle</b> is not a string, it is converted
* to an integer and applied as the ordinal value of a character.
* </p>
@ -52,7 +52,7 @@ function strtolower ($string) {}
* </p>
*/
#[Pure]
function strpos ($haystack, $needle, $offset = 0) {}
function strpos (string $haystack, string $needle, int $offset = 0) {}
/**
* Find position of first occurrence of a case-insensitive string
@ -60,7 +60,7 @@ function strpos ($haystack, $needle, $offset = 0) {}
* @param string $haystack <p>
* The string to search in
* </p>
* @param mixed $needle <p>
* @param string $needle <p>
* Note that the needle may be a string of one or
* more characters.
* </p>
@ -78,7 +78,8 @@ function strpos ($haystack, $needle, $offset = 0) {}
* stripos will return boolean false.
*/
#[Pure]
function stripos ($haystack, $needle, $offset = null) {}
function stripos (string $haystack, string $needle, int $offset)
{}
/**
* Find the position of the last occurrence of a substring in a string
@ -86,7 +87,7 @@ function stripos ($haystack, $needle, $offset = null) {}
* @param string $haystack <p>
* The string to search in.
* </p>
* @param mixed $needle <p>
* @param string $needle <p>
* If <b>needle</b> is not a string, it is converted to an integer and applied as the ordinal value of a character.
* </p>
* @param int $offset [optional] <p>
@ -103,7 +104,7 @@ function stripos ($haystack, $needle, $offset = null) {}
* </p>
*/
#[Pure]
function strrpos ($haystack, $needle, $offset = 0) {}
function strrpos (string $haystack, string $needle, int $offset = 0) {}
/**
* Find position of last occurrence of a case-insensitive string in a string
@ -111,7 +112,7 @@ function strrpos ($haystack, $needle, $offset = 0) {}
* @param string $haystack <p>
* The string to search in
* </p>
* @param mixed $needle <p>
* @param string $needle <p>
* Note that the needle may be a string of one or
* more characters.
* </p>
@ -132,7 +133,8 @@ function strrpos ($haystack, $needle, $offset = 0) {}
* If needle is not found, false is returned.
*/
#[Pure]
function strripos ($haystack, $needle, $offset = null) {}
function strripos (string $haystack, string $needle, int $offset)
{}
/**
* Reverse a string
@ -143,7 +145,7 @@ function strripos ($haystack, $needle, $offset = null) {}
* @return string the reversed string.
*/
#[Pure]
function strrev ($string) {}
function strrev (string $string) {}
/**
* Convert logical Hebrew text to visual text
@ -158,7 +160,8 @@ function strrev ($string) {}
* @return string the visual string.
*/
#[Pure]
function hebrev ($string, $max_chars_per_line = null) {}
function hebrev (string $string, int $max_chars_per_line)
{}
/**
* Convert logical Hebrew text to visual text with newline conversion
@ -174,7 +177,8 @@ function hebrev ($string, $max_chars_per_line = null) {}
* @removed 8.0
*/
#[Deprecated(replacement: 'nl2br(hebrev(%parameter0%))', since: '7.4')]
function hebrevc ($hebrew_text, $max_chars_per_line = null) {}
function hebrevc (string $hebrew_text, $max_chars_per_line)
{}
/**
* Inserts HTML line breaks before all newlines in a string
@ -188,7 +192,7 @@ function hebrevc ($hebrew_text, $max_chars_per_line = null) {}
* @return string the altered string.
*/
#[Pure]
function nl2br ($string, $use_xhtml = true) {}
function nl2br (string $string, bool $use_xhtml = true) {}
/**
* Returns trailing name component of path
@ -208,7 +212,8 @@ function nl2br ($string, $use_xhtml = true) {}
* @return string the base name of the given path.
*/
#[Pure]
function basename ($path, $suffix = null) {}
function basename (string $path, string $suffix)
{}
/**
* Returns a parent directory's path
@ -232,7 +237,7 @@ function basename ($path, $suffix = null) {}
* /component removed.
*/
#[Pure]
function dirname ($path, $levels = 1) {}
function dirname (string $path, int $levels = 1) {}
/**
* Returns information about a file path
@ -258,7 +263,8 @@ function dirname ($path, $levels = 1) {}
* string if not all elements are requested.
*/
#[Pure]
function pathinfo ($path, $flags = null) {}
function pathinfo (string $path, int $flags)
{}
/**
* Un-quotes a quoted string
@ -272,7 +278,7 @@ function pathinfo ($path, $flags = null) {}
* backslash (\).
*/
#[Pure]
function stripslashes ($string) {}
function stripslashes (string $string) {}
/**
* Un-quote string quoted with <function>addcslashes</function>
@ -283,7 +289,7 @@ function stripslashes ($string) {}
* @return string the unescaped string.
*/
#[Pure]
function stripcslashes ($string) {}
function stripcslashes (string $string) {}
/**
* Find the first occurrence of a string
@ -291,7 +297,7 @@ function stripcslashes ($string) {}
* @param string $haystack <p>
* The input string.
* </p>
* @param mixed $needle <p>
* @param string $needle <p>
* If needle is not a string, it is converted to
* an integer and applied as the ordinal value of a character.
* </p>
@ -304,7 +310,8 @@ function stripcslashes ($string) {}
* is not found.
*/
#[Pure]
function strstr ($haystack, $needle, $before_needle = null) {}
function strstr (string $haystack, string $needle, bool $before_needle)
{}
/**
* Case-insensitive <function>strstr</function>
@ -312,7 +319,7 @@ function strstr ($haystack, $needle, $before_needle = null) {}
* @param string $haystack <p>
* The string to search in
* </p>
* @param mixed $needle <p>
* @param string $needle <p>
* If needle is not a string, it is converted to
* an integer and applied as the ordinal value of a character.
* </p>
@ -325,7 +332,8 @@ function strstr ($haystack, $needle, $before_needle = null) {}
* found, returns false.
*/
#[Pure]
function stristr ($haystack, $needle, $before_needle = null) {}
function stristr (string $haystack, string $needle, bool $before_needle)
{}
/**
* Find the last occurrence of a character in a string
@ -333,7 +341,7 @@ function stristr ($haystack, $needle, $before_needle = null) {}
* @param string $haystack <p>
* The string to search in
* </p>
* @param mixed $needle <p>
* @param string $needle <p>
* If <b>needle</b> contains more than one character,
* only the first is used. This behavior is different from that of {@see strstr()}.
* </p>
@ -347,7 +355,7 @@ function stristr ($haystack, $needle, $before_needle = null) {}
* </p>
*/
#[Pure]
function strrchr ($haystack, $needle) {}
function strrchr (string $haystack, string $needle) {}
/**
* Randomly shuffles a string
@ -358,7 +366,7 @@ function strrchr ($haystack, $needle) {}
* @return string the shuffled string.
*/
#[Pure]
function str_shuffle ($string) {}
function str_shuffle (string $string) {}
/**
* Return information about words used in a string
@ -378,7 +386,8 @@ function str_shuffle ($string) {}
* format chosen.
*/
#[Pure]
function str_word_count ($string, $format = null, $characters = null) {}
function str_word_count (string $string, int $format, string $characters)
{}
/**
* Convert a string to an array
@ -402,7 +411,7 @@ function str_word_count ($string, $format = null, $characters = null) {}
* </p>
*/
#[Pure]
function str_split ($string, $length = 1) {}
function str_split (string $string, int $length = 1) {}
/**
* Search a string for any of a set of characters
@ -417,7 +426,7 @@ function str_split ($string, $length = 1) {}
* not found.
*/
#[Pure]
function strpbrk ($string, $characters) {}
function strpbrk (string $string, string $characters) {}
/**
* Binary safe comparison of two strings from an offset, up to length characters
@ -448,7 +457,8 @@ function strpbrk ($string, $characters) {}
* false.
*/
#[Pure]
function substr_compare ($haystack, $needle, $offset, $length = null, $case_insensitive = null) {}
function substr_compare (string $haystack, string $needle, int $offset, int $length, bool $case_insensitive)
{}
/**
* Locale based string comparison
@ -465,7 +475,7 @@ function substr_compare ($haystack, $needle, $offset, $length = null, $case_inse
* str2, and 0 if they are equal.
*/
#[Pure]
function strcoll ($string1, $string2) {}
function strcoll (string $string1, string $string2) {}
/**
* Formats a number as a currency string
@ -484,7 +494,7 @@ function strcoll ($string1, $string2) {}
* @see NumberFormatter
*/
#[Deprecated(reason: 'Use the NumberFormatter functionality', since: '7.4')]
function money_format ($format, $number) {}
function money_format (string $format, float $number) {}
/**
* Return part of a string
@ -550,18 +560,19 @@ function money_format ($format, $number) {}
* @return string|false the extracted part of string or false on failure.
*/
#[Pure]
function substr ($string, $offset, $length = null) {}
function substr (string $string, int $offset, int $length)
{}
/**
* Replace text within a portion of a string
* @link https://php.net/manual/en/function.substr-replace.php
* @param mixed $string <p>
* @param array|string $string <p>
* The input string.
* </p>
* @param string $replace <p>
* @param string|array $replace <p>
* The replacement string.
* </p>
* @param int $offset <p>
* @param array|int $offset <p>
* If start is positive, the replacing will
* begin at the start'th offset into
* string.
@ -588,7 +599,8 @@ function substr ($string, $offset, $length = null) {}
* array then array is returned.
*/
#[Pure]
function substr_replace ($string, $replace, $offset, $length = null) {}
function substr_replace (array|string $string, array|string $replace, array|int $offset, array|int $length = null)
{}
/**
* Quote meta characters
@ -599,7 +611,7 @@ function substr_replace ($string, $replace, $offset, $length = null) {}
* @return string the string with meta characters quoted.
*/
#[Pure]
function quotemeta ($string) {}
function quotemeta (string $string) {}
/**
* Make a string's first character uppercase
@ -610,7 +622,7 @@ function quotemeta ($string) {}
* @return string the resulting string.
*/
#[Pure]
function ucfirst ($string) {}
function ucfirst (string $string) {}
/**
* Make a string's first character lowercase
@ -621,7 +633,7 @@ function ucfirst ($string) {}
* @return string the resulting string.
*/
#[Pure]
function lcfirst ($string) {}
function lcfirst (string $string) {}
/**
* Uppercase the first character of each word in a string
@ -633,7 +645,7 @@ function lcfirst ($string) {}
* @return string the modified string.
*/
#[Pure]
function ucwords ($string, $separators = " \t\r\n\f\v") {}
function ucwords (string $string, string $separators = " \t\r\n\f\v") {}
/**
* Translate characters or replace substrings
@ -653,7 +665,7 @@ function ucwords ($string, $separators = " \t\r\n\f\v") {}
* to.
*/
#[Pure]
function strtr ($string, $from, $to) {}
function strtr (string $string, string $from, string $to) {}
/**
* Translate certain characters
@ -663,7 +675,7 @@ function strtr ($string, $from, $to) {}
* @return string A copy of str, translating all occurrences of each character in from to the corresponding character in to.
*/
#[Pure]
function strtr ($str, array $replace_pairs) {}
function strtr (string $str, array $replace_pairs) {}
/**
* Quote string with slashes
@ -674,7 +686,7 @@ function strtr ($str, array $replace_pairs) {}
* @return string the escaped string.
*/
#[Pure]
function addslashes ($string) {}
function addslashes (string $string) {}
/**
* Quote string with slashes in a C style
@ -727,7 +739,7 @@ function addslashes ($string) {}
* @return string the escaped string.
*/
#[Pure]
function addcslashes ($string, $characters) {}
function addcslashes (string $string, string $characters) {}
/**
* Strip whitespace (or other characters) from the end of a string.
@ -753,7 +765,7 @@ function addcslashes ($string, $characters) {}
* @return string the modified string.
*/
#[Pure]
function rtrim ($string, $characters = " \t\n\r\0\x0B") {}
function rtrim (string $string, string $characters = " \t\n\r\0\x0B") {}
/**
* Replace all occurrences of the search string with the replacement string
@ -779,7 +791,7 @@ function rtrim ($string, $characters = " \t\n\r\0\x0B") {}
* @param int &$count [optional] If passed, this will hold the number of matched and replaced needles.
* @return string|string[] This function returns a string or an array with the replaced values.
*/
function str_replace ($search, $replace, $subject, &$count = null) {}
function str_replace (array|string $search, array|string $replace, array|string $subject, &$count) {}
/**
* Case-insensitive version of <function>str_replace</function>.
@ -788,9 +800,9 @@ function str_replace ($search, $replace, $subject, &$count = null) {}
* Every replacement with search array is
* performed on the result of previous replacement.
* </p>
* @param mixed $replace <p>
* @param array|string $replace <p>
* </p>
* @param mixed $subject <p>
* @param array|string $subject <p>
* If subject is an array, then the search and
* replace is performed with every entry of
* subject, and the return value is an array as
@ -803,7 +815,8 @@ function str_replace ($search, $replace, $subject, &$count = null) {}
* </p>
* @return string|string[] a string or an array of replacements.
*/
function str_ireplace ($search, $replace, $subject, &$count = null) {}
function str_ireplace (array|string $search, array|string $replace, array|string $subject, &$count)
{}
/**
* Repeat a string
@ -823,7 +836,7 @@ function str_ireplace ($search, $replace, $subject, &$count = null) {}
* @return string the repeated string.
*/
#[Pure]
function str_repeat ($string, $times) {}
function str_repeat (string $string, int $times) {}
/**
* Return information about characters used in a string
@ -846,7 +859,8 @@ function str_repeat ($string, $times) {}
* 4 - a string containing all not used characters is returned.
*/
#[Pure]
function count_chars ($string, $mode = null) {}
function count_chars (string $string, int $mode)
{}
/**
* Split a string into smaller chunks
@ -863,7 +877,7 @@ function count_chars ($string, $mode = null) {}
* @return string the chunked string.
*/
#[Pure]
function chunk_split ($string, $length = 76, $separator = "\r\n") {}
function chunk_split (string $string, int $length = 76, string $separator = "\r\n") {}
/**
* Strip whitespace (or other characters) from the beginning and end of a string
@ -880,7 +894,7 @@ function chunk_split ($string, $length = 76, $separator = "\r\n") {}
* @return string The trimmed string.
*/
#[Pure]
function trim ($string, $characters = " \t\n\r\0\x0B") {}
function trim (string $string, string $characters = " \t\n\r\0\x0B") {}
/**
* Strip whitespace (or other characters) from the beginning of a string
@ -912,7 +926,7 @@ function trim ($string, $characters = " \t\n\r\0\x0B") {}
* (0x0B)), a vertical tab.
*/
#[Pure]
function ltrim ($string, $characters = " \t\n\r\0\x0B") {}
function ltrim (string $string, string $characters = " \t\n\r\0\x0B") {}
/**
* Strip HTML and PHP tags from a string
@ -932,7 +946,8 @@ function ltrim ($string, $characters = " \t\n\r\0\x0B") {}
* @return string the stripped string.
*/
#[Pure]
function strip_tags ($string, $allowed_tags = null) {}
function strip_tags (string $string, array|string $allowed_tags = null)
{}
/**
* Calculate the similarity between two strings
@ -950,7 +965,8 @@ function strip_tags ($string, $allowed_tags = null) {}
* </p>
* @return int the number of matching chars in both strings.
*/
function similar_text ($string1, $string2, &$percent = null) {}
function similar_text (string $string1, string $string2, &$percent)
{}
/**
* Split a string by a string
@ -982,12 +998,13 @@ function similar_text ($string1, $string2, &$percent = null) {}
* string will be returned.
*/
#[Pure]
function explode ($separator, $string, $limit = null) {}
function explode (string $separator, string $string, int $limit)
{}
/**
* Join array elements with a string
* @link https://php.net/manual/en/function.implode.php
* @param string $separator [optional]<p>
* @param array|string $separator [optional]<p>
* Defaults to an empty string. This is not the preferred usage of
* implode as glue would be
* the second parameter and thus, the bad prototype would be used.
@ -999,12 +1016,12 @@ function explode ($separator, $string, $limit = null) {}
* elements in the same order, with the glue string between each element.
*/
#[Pure]
function implode ($separator = "", array $array) {}
function implode (array|string $separator = "", array $array) {}
/**
* &Alias; <function>implode</function>
* @link https://php.net/manual/en/function.join.php
* @param string $separator [optional] <p>
* @param array|string $separator [optional] <p>
* Defaults to an empty string. This is not the preferred usage of
* implode as glue would be
* the second parameter and thus, the bad prototype would be used.
@ -1016,7 +1033,7 @@ function implode ($separator = "", array $array) {}
* elements in the same order, with the glue string between each element.
*/
#[Pure]
function join ($separator = "", $array) {}
function join (array|string $separator = "", array $array) {}
/**
* Set locale information
@ -1088,7 +1105,7 @@ function join ($separator = "", $array) {}
* on the system that PHP is running. It returns exactly
* what the system setlocale function returns.
*/
function setlocale ($category, $locales, ...$rest) {}
function setlocale (int $category, array|string $locales, ...$rest) {}
/**
* Get numeric formatting information

View File

@ -147,7 +147,7 @@ use JetBrains\PhpStorm\Pure;
* is not valid.
*/
#[Pure]
function nl_langinfo ($item) {}
function nl_langinfo (int $item) {}
/**
* Calculate the soundex key of a string
@ -158,7 +158,7 @@ function nl_langinfo ($item) {}
* @return string the soundex key as a string.
*/
#[Pure]
function soundex ($string) {}
function soundex (string $string) {}
/**
* Calculate Levenshtein distance between two strings
@ -188,7 +188,8 @@ function soundex ($string) {}
* two argument strings or -1, if one of the argument strings
* is longer than the limit of 255 characters.
*/
function levenshtein ($string1, $string2, $insertion_cost = null, $repetition_cost = null, $deletion_cost = null) {}
function levenshtein (string $string1, string $string2, int $insertion_cost, int $repetition_cost, int $deletion_cost) {
}
/**
* Generate a single-byte string from a number
@ -199,7 +200,7 @@ function levenshtein ($string1, $string2, $insertion_cost = null, $repetition_co
* @return string the specified character.
*/
#[Pure]
function chr ($codepoint) {}
function chr (int $codepoint) {}
/**
* Convert the first byte of a string to a value between 0 and 255
@ -210,7 +211,7 @@ function chr ($codepoint) {}
* @return int the ASCII value as an integer.
*/
#[Pure]
function ord ($character) {}
function ord (string $character) {}
/**
* Parses the string into variables
@ -225,7 +226,8 @@ function ord ($character) {}
* </p>
* @return void
*/
function parse_str ($string, array &$result = null) {}
function parse_str (string $string, &$result)
{}
/**
* Parse a CSV string into an array
@ -246,7 +248,7 @@ function parse_str ($string, array &$result = null) {}
* @return array an indexed array containing the fields read.
*/
#[Pure]
function str_getcsv ($string, $separator = ",", $enclosure = '"', $escape = "\\") {}
function str_getcsv (string $string, string $separator = ",", string $enclosure = '"', string $escape = "\\") {}
/**
* Pad a string to a certain length with another string
@ -274,7 +276,7 @@ function str_getcsv ($string, $separator = ",", $enclosure = '"', $escape = "\\"
* @return string the padded string.
*/
#[Pure]
function str_pad ($string, $length, $pad_string = " ", $pad_type = STR_PAD_RIGHT) {}
function str_pad (string $string, int $length, string $pad_string = " ", int $pad_type = STR_PAD_RIGHT) {}
/**
* &Alias; <function>rtrim</function>
@ -285,7 +287,7 @@ function str_pad ($string, $length, $pad_string = " ", $pad_type = STR_PAD_RIGHT
* @see rtrim()
*/
#[Pure]
function chop ($string, $characters = null) {}
function chop (string $string, string $characters) {}
/**
* &Alias; <function>strstr</function>
@ -295,12 +297,12 @@ function chop ($string, $characters = null) {}
* use the faster and less memory intensive function strpos() instead.
*
* @param string $haystack The input string.
* @param mixed $needle If needle is not a string, it is converted to an integer and applied as the ordinal value of a character.
* @param string $needle If needle is not a string, it is converted to an integer and applied as the ordinal value of a character.
* @param bool $before_needle [optional] If TRUE, strstr() returns the part of the haystack before the first occurrence of the needle (excluding the needle).
* @return string|false Returns the portion of string, or FALSE if needle is not found.
*/
#[Pure]
function strchr ($haystack, $needle, $before_needle = false) {}
function strchr (string $haystack, string $needle, bool $before_needle = false) {}
/**
* Return a formatted string
@ -327,7 +329,7 @@ function strchr ($haystack, $needle, $before_needle = false) {}
* format.
*/
#[Pure]
function sprintf ($format, ...$values) {}
function sprintf (string $format, ...$values) {}
/**
* Output a formatted string
@ -340,7 +342,7 @@ function sprintf ($format, ...$values) {}
* </p>
* @return int the length of the outputted string.
*/
function printf ($format, ...$values) {}
function printf (string $format, ...$values) {}
/**
* Output a formatted string
@ -353,7 +355,7 @@ function printf ($format, ...$values) {}
* </p>
* @return int the length of the outputted string.
*/
function vprintf ($format, array $values) {}
function vprintf (string $format, array $values) {}
/**
* Return a formatted string
@ -369,7 +371,7 @@ function vprintf ($format, array $values) {}
* for sprintf).
*/
#[Pure]
function vsprintf ($format, array $values) {}
function vsprintf (string $format, array $values) {}
/**
* Write a formatted string to a stream
@ -383,7 +385,7 @@ function vsprintf ($format, array $values) {}
* </p>
* @return int the length of the string written.
*/
function fprintf ($stream, $format, ...$values) {}
function fprintf ($stream, string $format, ...$values) {}
/**
* Write a formatted string to a stream
@ -398,7 +400,7 @@ function fprintf ($stream, $format, ...$values) {}
* </p>
* @return int the length of the outputted string.
*/
function vfprintf ($stream, $format, array $values) {}
function vfprintf ($stream, string $format, array $values) {}
/**
* Parses input from a string according to a format
@ -424,7 +426,7 @@ function vfprintf ($stream, $format, array $values) {}
* the function will return the number of assigned values. The optional
* parameters must be passed by reference.
*/
function sscanf ($string, $format, &...$vars) {}
function sscanf (string $string, string $format, mixed &...$vars) {}
/**
* Parses input from a file according to a format
@ -440,7 +442,7 @@ function sscanf ($string, $format, &...$vars) {}
* function will return the number of assigned values. The optional
* parameters must be passed by reference.
*/
function fscanf ($stream, $format, &...$vars) {}
function fscanf ($stream, string $format, mixed &...$vars) {}
/**
* Parse a URL and return its components
@ -484,7 +486,7 @@ function fscanf ($stream, $format, &...$vars) {}
"fragment" => "string",
])]
#[Pure]
function parse_url ($url, $component = -1) {}
function parse_url (string $url, int $component = -1) {}
/**
* URL-encodes string
@ -503,7 +505,7 @@ function parse_url ($url, $component = -1) {}
* are encoded as plus (+) signs.
*/
#[Pure]
function urlencode ($string) {}
function urlencode (string $string) {}
/**
* Decodes URL-encoded string
@ -514,7 +516,7 @@ function urlencode ($string) {}
* @return string the decoded string.
*/
#[Pure]
function urldecode ($string) {}
function urldecode (string $string) {}
/**
* URL-encode according to RFC 3986
@ -531,7 +533,7 @@ function urldecode ($string) {}
* media with character conversions (like some email systems).
*/
#[Pure]
function rawurlencode ($string) {}
function rawurlencode (string $string) {}
/**
* Decode URL-encoded strings
@ -542,12 +544,12 @@ function rawurlencode ($string) {}
* @return string the decoded URL, as a string.
*/
#[Pure]
function rawurldecode ($string) {}
function rawurldecode (string $string) {}
/**
* Generate URL-encoded query string
* @link https://php.net/manual/en/function.http-build-query.php
* @param mixed $data <p>
* @param object|array $data <p>
* May be an array or object containing properties.
* </p>
* <p>
@ -578,7 +580,7 @@ function rawurldecode ($string) {}
* @return string a URL-encoded string.
*/
#[Pure]
function http_build_query ($data, string $numeric_prefix = "", string $arg_separator = "&", int $encoding_type = PHP_QUERY_RFC1738){}
function http_build_query (object|array $data, string $numeric_prefix = "", string $arg_separator = "&", int $encoding_type = PHP_QUERY_RFC1738){}
/**
* Returns the target of a symbolic link
@ -588,7 +590,7 @@ function http_build_query ($data, string $numeric_prefix = "", string $arg_separ
* </p>
* @return string|false the contents of the symbolic link path or false on error.
*/
function readlink ($path) {}
function readlink (string $path) {}
/**
* Gets information about a link
@ -601,7 +603,7 @@ function readlink ($path) {}
* system call. Returns 0 or false in case of error.
*/
#[Pure]
function linkinfo ($path) {}
function linkinfo (string $path) {}
/**
* Creates a symbolic link
@ -614,7 +616,7 @@ function linkinfo ($path) {}
* </p>
* @return bool true on success or false on failure.
*/
function symlink ($target, $link) {}
function symlink (string $target, string $link) {}
/**
* Create a hard link
@ -634,7 +636,7 @@ function link (string $target , string $link):bool {}
* @param resource $context [optional] &note.context-support;
* @return bool true on success or false on failure.
*/
function unlink ($filename, $context = null):bool {}
function unlink (string $filename, $context):bool {}
/**
* Execute an external program
@ -666,7 +668,8 @@ function unlink ($filename, $context = null):bool {}
* To get the output of the executed command, be sure to set and use the
* output parameter.
*/
function exec ($command, array &$output = null, &$result_code = null) {}
function exec (string $command, &$output, &$result_code)
{}
/**
* Execute an external program and display the output
@ -682,7 +685,8 @@ function exec ($command, array &$output = null, &$result_code = null) {}
* @return string|false the last line of the command output on success, and false
* on failure.
*/
function system ($command, &$result_code = null) {}
function system (string $command, &$result_code)
{}
/**
* Escape shell metacharacters
@ -693,7 +697,7 @@ function system ($command, &$result_code = null) {}
* @return string The escaped string.
*/
#[Pure]
function escapeshellcmd ($command) {}
function escapeshellcmd (string $command) {}
/**
* Escape a string to be used as a shell argument
@ -704,7 +708,7 @@ function escapeshellcmd ($command) {}
* @return string The escaped string.
*/
#[Pure]
function escapeshellarg ($arg) {}
function escapeshellarg (string $arg) {}
/**
* Execute an external program and display raw output
@ -718,7 +722,8 @@ function escapeshellarg ($arg) {}
* </p>
* @return void
*/
function passthru ($command, &$result_code = null) {}
function passthru (string $command, &$result_code)
{}
/**
* Execute command via shell and return the complete output as a string
@ -728,7 +733,7 @@ function passthru ($command, &$result_code = null) {}
* </p>
* @return string|null The output from the executed command or NULL if an error occurred or the command produces no output.
*/
function shell_exec ($command) {}
function shell_exec (string $command) {}
/**
* Execute a command and open file pointers for input/output
@ -800,7 +805,8 @@ function shell_exec ($command) {}
* proc_close when you are finished with it. On failure
* returns false.
*/
function proc_open ($command, array $descriptor_spec, array &$pipes, $cwd = null, array $env_vars = null, array $options = null) {}
function proc_open (array|string $command, array $descriptor_spec, &$pipes, string $cwd, array $env_vars, array $options)
{}
/**
* Close a process opened by {@see proc_open} and return the exit code of that process
@ -828,7 +834,7 @@ function proc_close ($process) {}
* </p>
* @return bool the termination status of the process that was run.
*/
function proc_terminate ($process, $signal = 15) {}
function proc_terminate ($process, int $signal = 15) {}
/**
* Get information about a process opened by {@see proc_open}
@ -928,7 +934,7 @@ function proc_get_status ($process) {}
* If an error occurs, like the user lacks permission to change the priority,
* an error of level E_WARNING is also generated.
*/
function proc_nice ($priority) {}
function proc_nice (int $priority) {}
/**
* Generate a random integer
@ -938,7 +944,7 @@ function proc_nice ($priority) {}
* @return int A pseudo random value between min
* (or 0) and max (or getrandmax, inclusive).
*/
function rand ($min = 0, $max = null) {}
function rand (int $min = 0, int $max) {}
/**
* Seed the random number generator
@ -954,7 +960,7 @@ function rand ($min = 0, $max = null) {}
* </p>
* @return void
*/
function srand ($seed = null, $mode = MT_RAND_MT19937) {}
function srand (int $seed, int $mode = MT_RAND_MT19937) {}
/**
* Show largest possible random value
@ -976,7 +982,7 @@ function getrandmax () {}
* @return int A random integer value between min (or 0)
* and max (or mt_getrandmax, inclusive)
*/
function mt_rand ($min = 0, $max = null) {}
function mt_rand (int $min = 0, int $max) {}
/**
* Seeds the Mersenne Twister Random Number Generator
@ -989,7 +995,7 @@ function mt_rand ($min = 0, $max = null) {}
* </p>
* @return void
*/
function mt_srand ($seed = null, $mode = MT_RAND_MT19937) {}
function mt_srand (int $seed, int $mode = MT_RAND_MT19937) {}
/**
* Show largest possible random value
@ -1013,7 +1019,7 @@ function mt_getrandmax () {}
* protocol is not found.
*/
#[Pure]
function getservbyname ($service, $protocol) {}
function getservbyname (string $service, string $protocol) {}
/**
* Get Internet service which corresponds to port and protocol
@ -1028,7 +1034,7 @@ function getservbyname ($service, $protocol) {}
* @return string the Internet service name as a string.
*/
#[Pure]
function getservbyport ($port, $protocol) {}
function getservbyport (int $port, string $protocol) {}
/**
* Get protocol number associated with protocol name
@ -1039,7 +1045,7 @@ function getservbyport ($port, $protocol) {}
* @return int the protocol number or -1 if the protocol is not found.
*/
#[Pure]
function getprotobyname ($protocol) {}
function getprotobyname (string $protocol) {}
/**
* Get protocol name associated with protocol number
@ -1050,7 +1056,7 @@ function getprotobyname ($protocol) {}
* @return string the protocol name as a string.
*/
#[Pure]
function getprotobynumber ($protocol) {}
function getprotobynumber (int $protocol) {}
/**
* Gets PHP script owner's UID

View File

@ -28,7 +28,8 @@ function getlastmod () {}
* binary.
*/
#[Pure]
function base64_decode ($string, $strict = null) {}
function base64_decode (string $string, bool $strict)
{}
/**
* Encodes data with MIME base64
@ -39,7 +40,7 @@ function base64_decode ($string, $strict = null) {}
* @return string The encoded data, as a string.
*/
#[Pure]
function base64_encode ($string) {}
function base64_encode (string $string) {}
/**
* Uuencode a string
@ -50,7 +51,7 @@ function base64_encode ($string) {}
* @return string the uuencoded data.
*/
#[Pure]
function convert_uuencode ($string) {}
function convert_uuencode (string $string) {}
/**
* Decode a uuencoded string
@ -61,12 +62,12 @@ function convert_uuencode ($string) {}
* @return string the decoded data as a string.
*/
#[Pure]
function convert_uudecode ($string) {}
function convert_uudecode (string $string) {}
/**
* Absolute value
* @link https://php.net/manual/en/function.abs.php
* @param mixed $num <p>
* @param int|float $num <p>
* The numeric value to process
* </p>
* @return float|int The absolute value of number. If the
@ -76,12 +77,12 @@ function convert_uudecode ($string) {}
* bigger value range than integer).
*/
#[Pure]
function abs ($num) {}
function abs (int|float $num) {}
/**
* Round fractions up
* @link https://php.net/manual/en/function.ceil.php
* @param float $num <p>
* @param int|float $num <p>
* The value to round
* </p>
* @return float|false value rounded up to the next highest
@ -91,12 +92,12 @@ function abs ($num) {}
* usually bigger than that of integer.
*/
#[Pure]
function ceil ($num) {}
function ceil (int|float $num) {}
/**
* Round fractions down
* @link https://php.net/manual/en/function.floor.php
* @param float $num <p>
* @param int|float $num <p>
* The numeric value to round
* </p>
* @return float|false value rounded to the next lowest integer.
@ -105,14 +106,14 @@ function ceil ($num) {}
* usually bigger than that of integer.
*/
#[Pure]
function floor ($num) {}
function floor (int|float $num) {}
/**
* Returns the rounded value of val to specified precision (number of digits after the decimal point).
* precision can also be negative or zero (default).
* Note: PHP doesn't handle strings like "12,300.2" correctly by default. See converting from strings.
* @link https://php.net/manual/en/function.round.php
* @param float $num <p>
* @param int|float $num <p>
* The value to round
* </p>
* @param int $precision [optional] <p>
@ -127,7 +128,7 @@ function floor ($num) {}
* @return float The rounded value
*/
#[Pure]
function round ($num, $precision = 0, $mode = PHP_ROUND_HALF_UP) {}
function round (int|float $num, int $precision = 0, int $mode = PHP_ROUND_HALF_UP) {}
/**
* Sine
@ -138,7 +139,7 @@ function round ($num, $precision = 0, $mode = PHP_ROUND_HALF_UP) {}
* @return float The sine of arg
*/
#[Pure]
function sin ($num) {}
function sin (float $num) {}
/**
* Cosine
@ -149,7 +150,7 @@ function sin ($num) {}
* @return float The cosine of arg
*/
#[Pure]
function cos ($num) {}
function cos (float $num) {}
/**
* Tangent
@ -160,7 +161,7 @@ function cos ($num) {}
* @return float The tangent of arg
*/
#[Pure]
function tan ($num) {}
function tan (float $num) {}
/**
* Arc sine
@ -171,7 +172,7 @@ function tan ($num) {}
* @return float The arc sine of arg in radians
*/
#[Pure]
function asin ($num) {}
function asin (float $num) {}
/**
* Arc cosine
@ -182,7 +183,7 @@ function asin ($num) {}
* @return float The arc cosine of arg in radians.
*/
#[Pure]
function acos ($num) {}
function acos (float $num) {}
/**
* Arc tangent
@ -193,7 +194,7 @@ function acos ($num) {}
* @return float The arc tangent of arg in radians.
*/
#[Pure]
function atan ($num) {}
function atan (float $num) {}
/**
* Inverse hyperbolic tangent
@ -204,7 +205,7 @@ function atan ($num) {}
* @return float Inverse hyperbolic tangent of arg
*/
#[Pure]
function atanh ($num) {}
function atanh (float $num) {}
/**
* Arc tangent of two variables
@ -219,7 +220,7 @@ function atanh ($num) {}
* in radians.
*/
#[Pure]
function atan2 ($y, $x) {}
function atan2 (float $y, float $x) {}
/**
* Hyperbolic sine
@ -230,7 +231,7 @@ function atan2 ($y, $x) {}
* @return float The hyperbolic sine of arg
*/
#[Pure]
function sinh ($num) {}
function sinh (float $num) {}
/**
* Hyperbolic cosine
@ -241,7 +242,7 @@ function sinh ($num) {}
* @return float The hyperbolic cosine of arg
*/
#[Pure]
function cosh ($num) {}
function cosh (float $num) {}
/**
* Hyperbolic tangent
@ -252,7 +253,7 @@ function cosh ($num) {}
* @return float The hyperbolic tangent of arg
*/
#[Pure]
function tanh ($num) {}
function tanh (float $num) {}
/**
* Inverse hyperbolic sine
@ -263,7 +264,7 @@ function tanh ($num) {}
* @return float The inverse hyperbolic sine of arg
*/
#[Pure]
function asinh ($num) {}
function asinh (float $num) {}
/**
* Inverse hyperbolic cosine
@ -274,7 +275,7 @@ function asinh ($num) {}
* @return float The inverse hyperbolic cosine of arg
*/
#[Pure]
function acosh ($num) {}
function acosh (float $num) {}
/**
* Returns exp(number) - 1, computed in a way that is accurate even
@ -286,7 +287,7 @@ function acosh ($num) {}
* @return float 'e' to the power of arg minus one
*/
#[Pure]
function expm1($num) {}
function expm1(float $num) {}
/**
* Returns log(1 + number), computed in a way that is accurate even when
@ -298,7 +299,7 @@ function expm1($num) {}
* @return float log(1 + number)
*/
#[Pure]
function log1p($num) {}
function log1p(float $num) {}
/**
* Get value of pi
@ -319,7 +320,7 @@ function pi () {}
* else false.
*/
#[Pure]
function is_finite ($num) {}
function is_finite (float $num) {}
/**
* Finds whether a value is not a number
@ -331,7 +332,7 @@ function is_finite ($num) {}
* else false.
*/
#[Pure]
function is_nan ($num) {}
function is_nan (float $num) {}
/**
* Integer division
@ -346,7 +347,7 @@ function is_nan ($num) {}
* @since 7.0
*/
#[Pure]
function intdiv ($num1, $num2) {}
function intdiv (int $num1, int $num2) {}
/**
* Finds whether a value is infinite
@ -357,15 +358,15 @@ function intdiv ($num1, $num2) {}
* @return bool true if val is infinite, else false.
*/
#[Pure]
function is_infinite ($num) {}
function is_infinite (float $num) {}
/**
* Exponential expression
* @link https://php.net/manual/en/function.pow.php
* @param int|float $num <p>
* @param mixed $num <p>
* The base to use
* </p>
* @param int|float $exponent <p>
* @param mixed $exponent <p>
* The exponent
* </p>
* @return int|float base raised to the power of exp.
@ -374,7 +375,7 @@ function is_infinite ($num) {}
* If the power cannot be computed false will be returned instead.
*/
#[Pure]
function pow ($num, $exponent) {}
function pow (mixed $num, mixed $exponent) {}
/**
* Calculates the exponent of <constant>e</constant>
@ -385,7 +386,7 @@ function pow ($num, $exponent) {}
* @return float 'e' raised to the power of arg
*/
#[Pure]
function exp ($num) {}
function exp (float $num) {}
/**
* Natural logarithm
@ -402,7 +403,8 @@ function exp ($num) {}
* natural logarithm.
*/
#[Pure]
function log ($num, $base = null) {}
function log (float $num, float $base)
{}
/**
* Base-10 logarithm
@ -413,7 +415,7 @@ function log ($num, $base = null) {}
* @return float The base-10 logarithm of arg
*/
#[Pure]
function log10 ($num) {}
function log10 (float $num) {}
/**
* Square root
@ -425,7 +427,7 @@ function log10 ($num) {}
* or the special value NAN for negative numbers.
*/
#[Pure]
function sqrt ($num) {}
function sqrt (float $num) {}
/**
* Calculate the length of the hypotenuse of a right-angle triangle
@ -439,7 +441,7 @@ function sqrt ($num) {}
* @return float Calculated length of the hypotenuse
*/
#[Pure]
function hypot ($x, $y) {}
function hypot (float $x, float $y) {}
/**
* Converts the number in degrees to the radian equivalent
@ -450,7 +452,7 @@ function hypot ($x, $y) {}
* @return float The radian equivalent of number
*/
#[Pure]
function deg2rad ($num) {}
function deg2rad (float $num) {}
/**
* Converts the radian number to the equivalent number in degrees
@ -461,7 +463,7 @@ function deg2rad ($num) {}
* @return float The equivalent of number in degrees
*/
#[Pure]
function rad2deg ($num) {}
function rad2deg (float $num) {}
/**
* Binary to decimal
@ -472,7 +474,7 @@ function rad2deg ($num) {}
* @return int|float The decimal value of binary_string
*/
#[Pure]
function bindec ($binary_string) {}
function bindec (string $binary_string) {}
/**
* Hexadecimal to decimal
@ -483,7 +485,7 @@ function bindec ($binary_string) {}
* @return int|float The decimal representation of hex_string
*/
#[Pure]
function hexdec ($hex_string) {}
function hexdec (string $hex_string) {}
/**
* Octal to decimal
@ -494,7 +496,7 @@ function hexdec ($hex_string) {}
* @return int|float The decimal representation of octal_string
*/
#[Pure]
function octdec ($octal_string) {}
function octdec (string $octal_string) {}
/**
* Decimal to binary
@ -613,7 +615,7 @@ function octdec ($octal_string) {}
* @return string Binary string representation of number
*/
#[Pure]
function decbin ($num) {}
function decbin (int $num) {}
/**
* Decimal to octal
@ -624,7 +626,7 @@ function decbin ($num) {}
* @return string Octal string representation of number
*/
#[Pure]
function decoct ($num) {}
function decoct (int $num) {}
/**
* Decimal to hexadecimal
@ -635,7 +637,7 @@ function decoct ($num) {}
* @return string Hexadecimal string representation of number
*/
#[Pure]
function dechex ($num) {}
function dechex (int $num) {}
/**
* Convert a number between arbitrary bases
@ -652,7 +654,7 @@ function dechex ($num) {}
* @return string number converted to base tobase
*/
#[Pure]
function base_convert ($num, $from_base, $to_base) {}
function base_convert (string $num, int $from_base, int $to_base) {}
/**
* Format a number with grouped thousands
@ -668,7 +670,7 @@ function base_convert ($num, $from_base, $to_base) {}
* @return string A formatted version of number.
*/
#[Pure]
function number_format ($num , $decimals = 0 , $decimal_separator = '.' , $thousands_separator = ',' ) {}
function number_format (float $num , int $decimals = 0 , string $decimal_separator = '.' , string $thousands_separator = ',') {}
/**
* Returns the floating point remainder (modulo) of the division
@ -684,7 +686,7 @@ function number_format ($num , $decimals = 0 , $decimal_separator = '.' , $thous
* x/y
*/
#[Pure]
function fmod($num1, $num2) {}
function fmod(float $num1, float $num2) {}
/**
* Performs a floating-point division under
@ -704,7 +706,7 @@ function fdiv(float $num1, float $num2): float {}
* @return string|false a string representation of the address or false on failure.
*/
#[Pure]
function inet_ntop ($ip) {}
function inet_ntop (string $ip) {}
/**
* Converts a human readable IP address to its packed in_addr representation
@ -716,7 +718,7 @@ function inet_ntop ($ip) {}
* address
*/
#[Pure]
function inet_pton ($ip) {}
function inet_pton (string $ip) {}
/**
* Converts a string containing an (IPv4) Internet Protocol dotted address into a long integer
@ -728,18 +730,18 @@ function inet_pton ($ip) {}
* is invalid.
*/
#[Pure]
function ip2long ($ip) {}
function ip2long (string $ip) {}
/**
* Converts an long integer address into a string in (IPv4) internet standard dotted format
* @link https://php.net/manual/en/function.long2ip.php
* @param string|int $ip <p>
* @param int $ip <p>
* A proper address representation.
* </p>
* @return string the Internet IP address as a string.
*/
#[Pure]
function long2ip ($ip) {}
function long2ip (int $ip) {}
/**
* Gets the value of an environment variable
@ -755,7 +757,7 @@ function long2ip ($ip) {}
* is provided, or false on an error.
*/
#[Pure]
function getenv ($name = null, $local_only = false) {}
function getenv (string $name, bool $local_only = false) {}
/**
* Sets the value of an environment variable
@ -765,7 +767,7 @@ function getenv ($name = null, $local_only = false) {}
* </p>
* @return bool true on success or false on failure.
*/
function putenv ($assignment) {}
function putenv (string $assignment) {}
/**
* Gets options from the command line argument list
@ -782,11 +784,12 @@ function putenv ($assignment) {}
* For example, an longopts element "opt" recognizes an
* option --opt.
* Prior to PHP5.3.0 this parameter was only available on few systems
* @param int &$rest_index If the optind parameter is present, then the index where argument parsing stopped will be written to this variable.
* @param int &$rest_index [optional] If the optind parameter is present, then the index where argument parsing stopped will be written to this variable.
* @return string[]|false[]|false This function will return an array of option / argument pairs or false on
* failure.
*/
function getopt ($short_options, array $long_options = null, &$rest_index = null) {}
function getopt (string $short_options, array $long_options, &$rest_index)
{}
/**
* Gets system load average
@ -815,7 +818,7 @@ function sys_getloadavg () {}
* @return string|float
*/
#[Pure]
function microtime ($as_float = null) {}
function microtime (bool $as_float) {}
/**
* Get current time
@ -834,7 +837,7 @@ function microtime ($as_float = null) {}
* "dsttime" - type of dst correction
*/
#[Pure]
function gettimeofday ($as_float = null) {}
function gettimeofday (bool $as_float) {}
/**
* Gets the current resource usages
@ -847,7 +850,7 @@ function gettimeofday ($as_float = null) {}
* call. All entries are accessible by using their documented field names.
*/
#[Pure]
function getrusage ($mode = null) {}
function getrusage (int $mode) {}
/**
* Generate a unique ID
@ -870,7 +873,7 @@ function getrusage ($mode = null) {}
* @return string the unique identifier, as a string.
*/
#[Pure]
function uniqid ($prefix = "", $more_entropy = false) {}
function uniqid (string $prefix = "", bool $more_entropy = false) {}
/**
* Convert a quoted-printable string to an 8 bit string
@ -881,7 +884,7 @@ function uniqid ($prefix = "", $more_entropy = false) {}
* @return string the 8-bit binary string.
*/
#[Pure]
function quoted_printable_decode ($string) {}
function quoted_printable_decode (string $string) {}
/**
* Convert a 8 bit string to a quoted-printable string
@ -892,7 +895,7 @@ function quoted_printable_decode ($string) {}
* @return string the encoded string.
*/
#[Pure]
function quoted_printable_encode ($string) {}
function quoted_printable_encode (string $string) {}
/**
* Convert from one Cyrillic character set to another
@ -914,7 +917,7 @@ function quoted_printable_encode ($string) {}
*/
#[Pure]
#[Deprecated(since: '7.4',reason: 'Us mb_convert_string(), iconv() or UConverter instead.')]
function convert_cyr_string ($str, $from, $to) {}
function convert_cyr_string (string $str, string $from, string $to) {}
/**
* Gets the name of the owner of the current PHP script
@ -933,7 +936,7 @@ function get_current_user () {}
* </p>
* @return bool Returns TRUE on success, or FALSE on failure.
*/
function set_time_limit ($seconds) {}
function set_time_limit (int $seconds) {}
/**
* Gets the value of a PHP configuration option
@ -945,7 +948,7 @@ function set_time_limit ($seconds) {}
* option, or false if an error occurs.
*/
#[Pure]
function get_cfg_var ($option) {}
function get_cfg_var (string $option) {}
/**
* &Alias; <function>set_magic_quotes_runtime</function>
@ -954,7 +957,7 @@ function get_cfg_var ($option) {}
* @removed 7.0
*/
#[Deprecated(since: '5.3')]
function magic_quotes_runtime ($new_setting) {}
function magic_quotes_runtime (bool $new_setting) {}
/**
* Sets the current active configuration setting of magic_quotes_runtime
@ -966,7 +969,7 @@ function magic_quotes_runtime ($new_setting) {}
* @removed 7.0
*/
#[Deprecated(reason: "This function has been DEPRECATED as of PHP 5.4.0. Raises an E_CORE_ERROR", since: "5.3")]
function set_magic_quotes_runtime ($new_setting) {}
function set_magic_quotes_runtime (bool $new_setting) {}
/**
* Gets the current configuration setting of magic quotes gpc
@ -1019,7 +1022,8 @@ function get_magic_quotes_runtime () {}
* @removed 5.4
*/
#[Deprecated(reason: "This function has been DEPRECATED as of PHP 5.3.0", since: "5.3")]
function import_request_variables ($types, $prefix = null) {}
function import_request_variables (string $types, $prefix = null)
{}
/**
* Send an error message to the defined error handling routines
@ -1087,4 +1091,5 @@ function import_request_variables ($types, $prefix = null) {}
* </p>
* @return bool true on success or false on failure.
*/
function error_log ($message, $message_type = null, $destination = null, $additional_headers = null) {}
function error_log (string $message, int $message_type, string $destination, string $additional_headers) {
}

View File

@ -41,7 +41,7 @@ function error_get_last () {}
* </p>
* @return mixed|false the function result, or false on error.
*/
function call_user_func ($callback, ...$args) {}
function call_user_func (callable $callback, mixed ...$args) {}
/**
* Call a callback with an array of parameters
@ -54,7 +54,7 @@ function call_user_func ($callback, ...$args) {}
* </p>
* @return mixed|false the function result, or false on error.
*/
function call_user_func_array ($callback, array $args) {}
function call_user_func_array (callable $callback, array $args) {}
/**
* Call a user method on an specific object
@ -67,7 +67,7 @@ function call_user_func_array ($callback, array $args) {}
* @see call_user_func()
*/
#[Deprecated(reason: "use call_user_func() instead", since: "5.3")]
function call_user_method ($method_name, &$obj, ...$parameter) {}
function call_user_method (string $method_name, object &$obj, ...$parameter) {}
/**
* Call a user method given with an array of parameters
@ -80,7 +80,7 @@ function call_user_method ($method_name, &$obj, ...$parameter) {}
* @see call_user_func()
*/
#[Deprecated(reason: "use call_user_func() instead", since: "5.3")]
function call_user_method_array ($method_name, &$obj, array $params) {}
function call_user_method_array (string $method_name, object &$obj, array $params) {}
/**
* Call a static method
@ -95,12 +95,12 @@ function call_user_method_array ($method_name, &$obj, array $params) {}
* </p>
* @return mixed|false the function result, or false on error.
*/
function forward_static_call ($callback, ...$args) {}
function forward_static_call (callable $callback, ...$args) {}
/**
* Call a static method and pass the arguments as array
* @link https://php.net/manual/en/function.forward-static-call-array.php
* @param callback|array|string $callback <p>
* @param callable $callback <p>
* The function or method to be called. This parameter may be an array,
* with the name of the class, and the method, or a string, with a function
* name.
@ -108,7 +108,7 @@ function forward_static_call ($callback, ...$args) {}
* @param array $args
* @return mixed|false the function result, or false on error.
*/
function forward_static_call_array ($callback, array $args) {}
function forward_static_call_array (callable $callback, array $args) {}
/**
* Generates a storable representation of a value
@ -136,7 +136,7 @@ function forward_static_call_array ($callback, array $args) {}
* @return string a string containing a byte-stream representation of
* value that can be stored anywhere.
*/
function serialize ($value) {}
function serialize (mixed $value) {}
/**
* Creates a PHP value from a stored representation
@ -190,7 +190,7 @@ function unserialize (string $data, array $options = []) {}
* @param mixed ...$values [optional]
* @return void
*/
function var_dump ($value, ...$values) {}
function var_dump (mixed $value, ...$values) {}
/**
* Outputs or returns a parsable string representation of a variable
@ -207,7 +207,8 @@ function var_dump ($value, ...$values) {}
* parameter is used and evaluates to true. Otherwise, this function will
* return null.
*/
function var_export ($value, $return = null) {}
function var_export (mixed $value, bool $return)
{}
/**
* Dumps a string representation of an internal zend value to output
@ -218,7 +219,7 @@ function var_export ($value, $return = null) {}
* </p>
* @return void
*/
function debug_zval_dump ($value, ...$values) {}
function debug_zval_dump (mixed $value, mixed ...$values) {}
/**
* Prints human-readable information about a variable
@ -237,7 +238,8 @@ function debug_zval_dump ($value, ...$values) {}
* will be presented in a format that shows keys and elements. Similar
* notation is used for objects.
*/
function print_r ($value, $return = null) {}
function print_r (mixed $value, bool $return)
{}
/**
* Returns the amount of memory allocated to PHP
@ -250,7 +252,7 @@ function print_r ($value, $return = null) {}
* @return int the memory amount in bytes.
*/
#[Pure]
function memory_get_usage ($real_usage = false) {}
function memory_get_usage (bool $real_usage = false) {}
/**
* Returns the peak of memory allocated by PHP
@ -263,7 +265,7 @@ function memory_get_usage ($real_usage = false) {}
* @return int the memory peak in bytes.
*/
#[Pure]
function memory_get_peak_usage ($real_usage = false) {}
function memory_get_peak_usage (bool $real_usage = false) {}
/**
* Register a function for execution on shutdown
@ -288,7 +290,7 @@ function memory_get_peak_usage ($real_usage = false) {}
* </p>
* @return void
*/
function register_shutdown_function ($callback, ...$args) {}
function register_shutdown_function (callable $callback, ...$args) {}
/**
* Register a function for execution on each tick
@ -301,7 +303,7 @@ function register_shutdown_function ($callback, ...$args) {}
* </p>
* @return bool true on success or false on failure.
*/
function register_tick_function ($callback, ...$args) {}
function register_tick_function (callable $callback, ...$args) {}
/**
* De-register a function for execution on each tick
@ -312,7 +314,7 @@ function register_tick_function ($callback, ...$args) {}
* </p>
* @return void
*/
function unregister_tick_function ($callback) {}
function unregister_tick_function (callable $callback) {}
/**
* Syntax highlighting of a file
@ -328,7 +330,7 @@ function unregister_tick_function ($callback) {}
* code as a string instead of printing it out. Otherwise, it will return
* true on success, false on failure.
*/
function highlight_file ($filename, $return = false) {}
function highlight_file (string $filename, bool $return = false) {}
/**
* &Alias; <function>highlight_file</function>
@ -337,7 +339,7 @@ function highlight_file ($filename, $return = false) {}
* @param bool $return [optional]
* @return string|bool
*/
function show_source ($filename, $return = false) {}
function show_source (string $filename, bool $return = false) {}
/**
* Syntax highlighting of a string
@ -353,7 +355,7 @@ function show_source ($filename, $return = false) {}
* code as a string instead of printing it out. Otherwise, it will return
* true on success, false on failure.
*/
function highlight_string ($string, $return = false) {}
function highlight_string (string $string, bool $return = false) {}
/**
* Get the system's high resolution time
@ -364,7 +366,7 @@ function highlight_string ($string, $return = false) {}
* Otherwise the nanoseconds are returned as integer (64bit platforms) or float (32bit platforms).
*/
#[Pure]
function hrtime($as_number = false) {}
function hrtime(bool $as_number = false) {}
/**
* Return source with stripped comments and whitespace
@ -382,7 +384,7 @@ function hrtime($as_number = false) {}
* #29606.
*/
#[Pure]
function php_strip_whitespace ($filename) {}
function php_strip_whitespace (string $filename) {}
/**
* Gets the value of a configuration option
@ -395,7 +397,7 @@ function php_strip_whitespace ($filename) {}
* an empty string on failure or for null values.
*/
#[Pure]
function ini_get ($option) {}
function ini_get (string $option) {}
/**
* Gets all configuration options
@ -431,7 +433,7 @@ function ini_get ($option) {}
* why access shows the appropriate bitmask values.
*/
#[Pure]
function ini_get_all ($extension = null, $details = null) {}
function ini_get_all (string $extension, bool $details) {}
/**
* Sets the value of a configuration option
@ -449,7 +451,7 @@ function ini_get_all ($extension = null, $details = null) {}
* </p>
* @return string|false the old value on success, false on failure.
*/
function ini_set ($option, $value) {}
function ini_set (string $option, string $value) {}
/**
* &Alias; <function>ini_set</function>
@ -459,7 +461,7 @@ function ini_set ($option, $value) {}
* @param string $value
* @return string|false
*/
function ini_alter ($option, $value) {}
function ini_alter (string $option, string $value) {}
/**
* Restores the value of a configuration option
@ -470,7 +472,7 @@ function ini_alter ($option, $value) {}
* </p>
* @return void
*/
function ini_restore ($option) {}
function ini_restore (string $option) {}
/**
* Gets the current include_path configuration option
@ -489,7 +491,7 @@ function get_include_path () {}
* @return string|bool the old include_path on
* success or false on failure.
*/
function set_include_path ($include_path) {}
function set_include_path (string $include_path) {}
/**
* Restores the value of the include_path configuration option
@ -575,18 +577,18 @@ function restore_include_path () {}
* setcookie successfully runs, it will return true.
* This does not indicate whether the user accepted the cookie.
*/
function setcookie ($name, $value = "", $expires_or_options = 0, $path = "", $domain = "", $secure = false, $httponly = false) {}
function setcookie (string $name, $value = "", $expires_or_options = 0, $path = "", $domain = "", $secure = false, $httponly = false) {}
/**
* Send a cookie
*
* @link https://php.net/manual/en/function.setcookie.php
*
* @param string $name The name of the cookie.
* @param string $value [optional] The value of the cookie. This value is stored on the clients
* @param string $name The name of the cookie.
* @param string $value [optional] The value of the cookie. This value is stored on the clients
* computer; do not store sensitive information.
* Assuming the name is 'cookiename', this value is retrieved through $_COOKIE['cookiename']
* @param array $options [optional] An associative array which may have any of the keys expires, path, domain, secure,
* @param array $options [optional] An associative array which may have any of the keys expires, path, domain, secure,
* httponly and samesite. The values have the same meaning as described for the parameters with
* the same name. The value of the samesite element should be either Lax or Strict.
* If any of the allowed options are not given, their default values are the same
@ -598,7 +600,7 @@ function setcookie ($name, $value = "", $expires_or_options = 0, $path = "", $do
* This does not indicate whether the user accepted the cookie.
* @since 7.3
*/
function setcookie($name, $value = '', array $options = []) {}
function setcookie(string $name, $value = '', array $options = []) {}
/**
* Send a cookie without urlencoding the cookie value
@ -612,18 +614,18 @@ function setcookie($name, $value = '', array $options = []) {}
* @param bool $httponly [optional]
* @return bool true on success or false on failure.
*/
function setrawcookie ($name, $value = '', $expires_or_options = 0, $path = "", $domain = "", $secure = false, $httponly = false) {}
function setrawcookie (string $name, $value = '', $expires_or_options = 0, $path = "", $domain = "", $secure = false, $httponly = false) {}
/**
* Send a cookie without urlencoding the cookie value
*
* @link https://php.net/manual/en/function.setrawcookie.php
*
* @param string $name The name of the cookie.
* @param string $value [optional] The value of the cookie. This value is stored on the clients
* @param string $name The name of the cookie.
* @param string $value [optional] The value of the cookie. This value is stored on the clients
* computer; do not store sensitive information.
* Assuming the name is 'cookiename', this value is retrieved through $_COOKIE['cookiename']
* @param array $options [optional] An associative array which may have any of the keys expires, path, domain, secure,
* @param array $options [optional] An associative array which may have any of the keys expires, path, domain, secure,
* httponly and samesite. The values have the same meaning as described for the parameters with
* the same name. The value of the samesite element should be either Lax or Strict.
* If any of the allowed options are not given, their default values are the same
@ -634,7 +636,7 @@ function setrawcookie ($name, $value = '', $expires_or_options = 0, $path = "",
* setcookie successfully runs, it will return true.
* This does not indicate whether the user accepted the cookie.
*/
function setrawcookie ($name, $value = '', array $options = []) {}
function setrawcookie (string $name, $value = '', array $options = []) {}
/**
* Send a raw HTTP header
@ -670,7 +672,8 @@ function setrawcookie ($name, $value = '', array $options = []) {}
* </p>
* @return void
*/
function header ($header, $replace = true, $response_code = null) {}
function header (string $header, bool $replace = true, int $response_code)
{}
/**
* Remove previously set headers
@ -681,7 +684,7 @@ function header ($header, $replace = true, $response_code = null) {}
* This parameter is case-insensitive.
* @return void
*/
function header_remove ($name = null) {}
function header_remove (string $name) {}
/**
* Checks if or where headers have been sent
@ -699,7 +702,7 @@ function header_remove ($name = null) {}
* @return bool headers_sent will return false if no HTTP headers
* have already been sent or true otherwise.
*/
function headers_sent (&$filename = null, &$line = null) {}
function headers_sent (&$filename, &$line) {}
/**
* Returns a list of response headers sent (or ready to send)
@ -754,7 +757,7 @@ function connection_status () {}
* </p>
* @return int the previous setting, as an integer.
*/
function ignore_user_abort ($enable = null) {}
function ignore_user_abort (bool $enable) {}
/**
* Parse a configuration file
@ -784,7 +787,7 @@ function ignore_user_abort ($enable = null) {}
* @return array|false The settings are returned as an associative array on success,
* and false on failure.
*/
function parse_ini_file ($filename, $process_sections = false, $scanner_mode = INI_SCANNER_NORMAL) {}
function parse_ini_file (string $filename, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL) {}
/**
* Parse a configuration string
@ -807,7 +810,7 @@ function parse_ini_file ($filename, $process_sections = false, $scanner_mode = I
* and false on failure.
*/
#[Pure]
function parse_ini_string ($ini_string, $process_sections = false, $scanner_mode = INI_SCANNER_NORMAL) {}
function parse_ini_string (string $ini_string, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL) {}
/**
* Tells whether the file was uploaded via HTTP POST
@ -818,7 +821,7 @@ function parse_ini_string ($ini_string, $process_sections = false, $scanner_mode
* @return bool true on success or false on failure.
*/
#[Pure]
function is_uploaded_file ($filename) {}
function is_uploaded_file (string $filename) {}
/**
* Moves an uploaded file to a new location
@ -840,7 +843,7 @@ function is_uploaded_file ($filename) {}
* move_uploaded_file will return
* false. Additionally, a warning will be issued.
*/
function move_uploaded_file ($from, $to) {}
function move_uploaded_file (string $from, string $to) {}
/**
* @return array|false
@ -859,7 +862,7 @@ function net_get_interfaces() {}
* on failure.
*/
#[Pure]
function gethostbyaddr ($ip) {}
function gethostbyaddr (string $ip) {}
/**
* Get the IPv4 address corresponding to a given Internet host name
@ -871,11 +874,11 @@ function gethostbyaddr ($ip) {}
* hostname on failure.
*/
#[Pure]
function gethostbyname ($hostname) {}
function gethostbyname (string $hostname) {}
/**
* Get a list of IPv4 addresses corresponding to a given Internet host
name
* name
* @link https://php.net/manual/en/function.gethostbynamel.php
* @param string $hostname <p>
* The host name.
@ -884,7 +887,7 @@ function gethostbyname ($hostname) {}
* hostname could not be resolved.
*/
#[Pure]
function gethostbynamel ($hostname) {}
function gethostbynamel(string $hostname) {}
/**
* Gets the host name
@ -908,7 +911,7 @@ function gethostname () {}
* </p>
* @return bool Returns <b>TRUE</b> if any records are found; returns <b>FALSE</b> if no records were found or if an error occurred.
*/
function dns_check_record ($hostname, $type = 'MX') {}
function dns_check_record (string $hostname, string $type = 'MX') {}
/**
* Check DNS records corresponding to a given Internet host name or IP address
@ -925,7 +928,8 @@ function dns_check_record ($hostname, $type = 'MX') {}
* were found or if an error occurred.
*/
#[Pure]
function checkdnsrr ($hostname, $type = null) {}
function checkdnsrr (string $hostname, string $type)
{}
/**
* &Alias; <function>getmxrr</function>
@ -935,7 +939,7 @@ function checkdnsrr ($hostname, $type = null) {}
* @param array &$weights [optional]
* @return bool
*/
function dns_get_mx ($hostname, array &$hosts, array &$weights = null) {}
function dns_get_mx (string $hostname, &$hosts, &$weights) {}
/**
* Get MX records corresponding to a given Internet host name
@ -954,7 +958,8 @@ function dns_get_mx ($hostname, array &$hosts, array &$weights = null) {}
* @return bool true if any records are found; returns false if no records
* were found or if an error occurred.
*/
function getmxrr ($hostname, array &$hosts, array &$weights = null) {}
function getmxrr (string $hostname, &$hosts, &$weights)
{}
/**
* Fetch DNS Resource Records associated with a hostname
@ -1163,4 +1168,5 @@ function getmxrr ($hostname, array &$hosts, array &$weights = null) {}
* </tr>
* </table>
*/
function dns_get_record ($hostname, $type = DNS_ANY, array &$authoritative_name_servers = null, array &$additional_records = null, $raw = false) {}
function dns_get_record (string $hostname, int $type = DNS_ANY, &$authoritative_name_servers, &$additional_records, bool $raw = false)
{}

View File

@ -11,7 +11,7 @@ use JetBrains\PhpStorm\Pure;
* @since 5.5
*/
#[Pure]
function boolval($value) {}
function boolval(mixed $value) {}
/**
* Get the integer value of a variable
@ -40,7 +40,7 @@ function boolval($value) {}
* apply.
*/
#[Pure]
function intval ($value, $base = 10) {}
function intval (mixed $value, int $base = 10) {}
/**
* Get float value of a variable
@ -49,7 +49,7 @@ function intval ($value, $base = 10) {}
* @return float value of the given variable. Empty arrays return 0, non-empty arrays return 1.
*/
#[Pure]
function floatval ($value) {}
function floatval (mixed $value) {}
/**
* (PHP 4.2.0, PHP 5)<br/>
@ -61,7 +61,7 @@ function floatval ($value) {}
* @return float value of the given variable. Empty arrays return 0, non-empty arrays return 1.
*/
#[Pure]
function doubleval ($value) {}
function doubleval (mixed $value) {}
/**
* Get string value of a variable
@ -76,7 +76,7 @@ function doubleval ($value) {}
* @return string The string value of var.
*/
#[Pure]
function strval ($value) {}
function strval (mixed $value) {}
/**
* Get the type of a variable
@ -99,7 +99,7 @@ function strval ($value) {}
* "resource (closed)" since 7.2.0
*/
#[Pure]
function gettype ($value) {}
function gettype (mixed $value) {}
/**
* Set the type of a variable
@ -135,7 +135,7 @@ function gettype ($value) {}
* </ul>
* @return bool true on success or false on failure.
*/
function settype (&$var, $type) {}
function settype (mixed &$var, string $type) {}
/**
* Finds whether a variable is null.
@ -147,7 +147,7 @@ function settype (&$var, $type) {}
* otherwise.
*/
#[Pure]
function is_null ($value) {}
function is_null (mixed $value) {}
/**
* Finds whether a variable is a resource
@ -159,7 +159,7 @@ function is_null ($value) {}
* false otherwise.
*/
#[Pure]
function is_resource ($value) {}
function is_resource (mixed $value) {}
/**
* Finds out whether a variable is a boolean
@ -171,7 +171,7 @@ function is_resource ($value) {}
* false otherwise.
*/
#[Pure]
function is_bool ($value) {}
function is_bool (mixed $value) {}
/**
* &Alias; <function>is_int</function>
@ -183,7 +183,7 @@ function is_bool ($value) {}
* false otherwise.
*/
#[Pure]
function is_long ($value) {}
function is_long (mixed $value) {}
/**
* Finds whether the type of a variable is float
@ -195,7 +195,7 @@ function is_long ($value) {}
* false otherwise.
*/
#[Pure]
function is_float ($value) {}
function is_float (mixed $value) {}
/**
* Find whether the type of a variable is integer
@ -207,7 +207,7 @@ function is_float ($value) {}
* false otherwise.
*/
#[Pure]
function is_int ($value) {}
function is_int (mixed $value) {}
/**
* &Alias; <function>is_int</function>
@ -219,7 +219,7 @@ function is_int ($value) {}
* false otherwise.
*/
#[Pure]
function is_integer ($value) {}
function is_integer (mixed $value) {}
/**
* &Alias; <function>is_float</function>
@ -231,7 +231,7 @@ function is_integer ($value) {}
* false otherwise.
*/
#[Pure]
function is_double ($value) {}
function is_double (mixed $value) {}
/**
* &Alias; <function>is_float</function>
@ -244,7 +244,7 @@ function is_double ($value) {}
*/
#[Pure]
#[Deprecated(since: '7.4')]
function is_real ($var) {}
function is_real (mixed $var) {}
/**
* Finds whether a variable is a number or a numeric string
@ -256,7 +256,7 @@ function is_real ($var) {}
* string, false otherwise.
*/
#[Pure]
function is_numeric ($value) {}
function is_numeric (mixed $value) {}
/**
* Find whether the type of a variable is string
@ -268,7 +268,7 @@ function is_numeric ($value) {}
* false otherwise.
*/
#[Pure]
function is_string ($value) {}
function is_string (mixed $value) {}
/**
* Finds whether a variable is an array
@ -280,7 +280,7 @@ function is_string ($value) {}
* false otherwise.
*/
#[Pure]
function is_array ($value) {}
function is_array (mixed $value) {}
/**
* Finds whether a variable is an object
@ -292,7 +292,7 @@ function is_array ($value) {}
* Since 7.2.0 returns true for unserialized objects without a class definition (class of <b>__PHP_Incomplete_Class</b>).
*/
#[Pure]
function is_object ($value) {}
function is_object (mixed $value) {}
/**
* Finds whether a variable is a scalar
@ -304,7 +304,7 @@ function is_object ($value) {}
* otherwise.
*/
#[Pure]
function is_scalar ($value) {}
function is_scalar (mixed $value) {}
/**
* Verify that the contents of a variable can be called as a function
@ -329,7 +329,8 @@ function is_scalar ($value) {}
* @return bool <b>TRUE</b> if $var is callable, <b>FALSE</b>
* otherwise.
*/
function is_callable ($value, $syntax_only = null, &$callable_name = null) {}
function is_callable (mixed $value, bool $syntax_only, &$callable_name)
{}
/**
* Verify that the contents of a variable is a countable value
@ -340,7 +341,7 @@ function is_callable ($value, $syntax_only = null, &$callable_name = null) {}
* @since 7.3
*/
#[Pure]
function is_countable($value) {}
function is_countable(mixed $value) {}
/**
* Closes process file pointer
@ -375,7 +376,7 @@ function pclose ($handle) {}
* <p>
* If an error occurs, returns false.
*/
function popen ($command, $mode) {}
function popen (string $command, string $mode) {}
/**
* Outputs a file
@ -392,7 +393,8 @@ function popen ($command, $mode) {}
* </p>
* @return false|int the number of bytes read from the file, or FALSE on failure
*/
function readfile ($filename, $use_include_path = null, $context = null) {}
function readfile (string $filename, bool $use_include_path, $context)
{}
/**
* Rewind the position of a file pointer
@ -414,7 +416,7 @@ function rewind ($stream) {}
* @param resource $context [optional] &note.context-support;
* @return bool true on success or false on failure.
*/
function rmdir ($directory, $context = null) {}
function rmdir (string $directory, $context) {}
/**
* Changes the current umask
@ -425,7 +427,7 @@ function rmdir ($directory, $context = null) {}
* @return int umask without arguments simply returns the
* current umask otherwise the old umask is returned.
*/
function umask ($mask = null) {}
function umask (int $mask) {}
/**
* Closes an open file pointer
@ -478,7 +480,7 @@ function fgetc ($stream) {}
* <p>
* If an error occurs, returns false.
*/
function fgets ($stream, $length = null) {}
function fgets ($stream, int $length) {}
/**
* Gets line from file pointer and strip HTML tags
@ -500,7 +502,7 @@ function fgets ($stream, $length = null) {}
* @removed 8.0
*/
#[Deprecated(since: '7.3')]
function fgetss ($handle, $length = null, $allowable_tags = null) {}
function fgetss ($handle, int $length = null, $allowable_tags = null) {}
/**
* Binary-safe file read
@ -511,7 +513,7 @@ function fgetss ($handle, $length = null, $allowable_tags = null) {}
* </p>
* @return string|false the read string or false on failure.
*/
function fread ($stream, $length) {}
function fread ($stream, int $length) {}
/**
* Opens file or URL
@ -694,7 +696,7 @@ function fread ($stream, $length) {}
* @param resource $context [optional] &note.context-support;
* @return resource|false a file pointer resource on success, or false on error.
*/
function fopen ($filename, $mode, $use_include_path = false, $context = null) {}
function fopen (string $filename, string $mode, bool $use_include_path = false, $context) {}
/**
* Output all remaining data on a file pointer
@ -729,7 +731,7 @@ function fpassthru ($stream) {}
* </p>
* @return bool true on success or false on failure.
*/
function ftruncate ($stream, $size) {}
function ftruncate ($stream, int $size) {}
/**
* Gets information about a file using an open file pointer
@ -766,7 +768,7 @@ function fstat ($stream) {}
* @return int Upon success, returns 0; otherwise, returns -1. Note that seeking
* past EOF is not considered an error.
*/
function fseek ($stream, $offset, $whence = SEEK_SET) {}
function fseek ($stream, int $offset, int $whence = SEEK_SET) {}
/**
* Returns the current position of the file read/write pointer
@ -814,7 +816,8 @@ function fflush ($stream) {}
* </p>
* @return int|false the number of bytes written, or <b>FALSE</b> on error.
*/
function fwrite ($stream, $data, $length = null) {}
function fwrite ($stream, string $data, int $length)
{}
/**
* &Alias; <function>fwrite</function>
@ -839,7 +842,8 @@ function fwrite ($stream, $data, $length = null) {}
* @link https://php.net/manual/en/function.fputs.php
* Binary-safe file write
*/
function fputs ($stream, $data, $length = null) {}
function fputs ($stream, string $data, int $length)
{}
/**
* Attempts to create the directory specified by pathname.
@ -867,7 +871,7 @@ function fputs ($stream, $data, $length = null) {}
* @param resource $context [optional] &note.context-support;
* @return bool true on success or false on failure.
*/
function mkdir ($directory, $permissions = 0777, $recursive = false, $context = null) {}
function mkdir (string $directory, int $permissions = 0777, bool $recursive = false, $context) {}
/**
* Renames a file or directory
@ -885,7 +889,7 @@ function mkdir ($directory, $permissions = 0777, $recursive = false, $context =
* @param resource $context [optional] &note.context-support;
* @return bool true on success or false on failure.
*/
function rename ($from, $to, $context = null) {}
function rename (string $from, string $to, $context) {}
/**
* Copies file
@ -907,7 +911,8 @@ function rename ($from, $to, $context = null) {}
* </p>
* @return bool true on success or false on failure.
*/
function copy ($from, $to, $context = null) {}
function copy (string $from, string $to, $context)
{}
/**
* Create file with unique file name
@ -922,7 +927,7 @@ function copy ($from, $to, $context = null) {}
* @return string|false the new temporary filename, or false on
* failure.
*/
function tempnam ($directory, $prefix) {}
function tempnam (string $directory, string $prefix) {}
/**
* Creates a temporary file
@ -961,7 +966,8 @@ function tmpfile () {}
* use rtrim if you do not want the line ending
* present.
*/
function file ($filename, $flags = null, $context = null) {}
function file (string $filename, int $flags, $context)
{}
/**
* Reads entire file into a string
@ -987,7 +993,8 @@ function file ($filename, $flags = null, $context = null) {}
* </p>
* @return string|false The function returns the read data or false on failure.
*/
function file_get_contents ($filename, $use_include_path = false, $context = null, $offset = 0, $length = null) {}
function file_get_contents (string $filename, bool $use_include_path = false, $context, int $offset = 0, int $length)
{}
/**
* Write a string to a file
@ -1060,4 +1067,5 @@ function file_get_contents ($filename, $use_include_path = false, $context = nul
* @return int|false The function returns the number of bytes that were written to the file, or
* false on failure.
*/
function file_put_contents ($filename, $data, $flags = 0, $context = null) {}
function file_put_contents (string $filename, mixed $data, int $flags = 0, $context)
{}

View File

@ -77,7 +77,8 @@ 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, $seconds, $microseconds = null) {}
function stream_select (array &$read, array &$write, array &$except, int $seconds, int $microseconds)
{}
/**
* Create a stream context
@ -97,7 +98,7 @@ function stream_select (array &$read, array &$write, array &$except, $seconds, $
* </p>
* @return resource A stream context resource.
*/
function stream_context_create (array $options = null, array $params = null) {}
function stream_context_create (array $options, array $params) {}
/**
* Set parameters for a stream/wrapper/context
@ -138,7 +139,7 @@ function stream_context_get_params ($context) {}
* @param mixed $value
* @return bool true on success or false on failure.
*/
function stream_context_set_option ($context, $wrapper_or_options, $option_name, $value) {}
function stream_context_set_option ($context, string $wrapper_or_options, string $option_name, mixed $value) {}
/**
* Sets an option for a stream/wrapper/context
@ -171,7 +172,7 @@ function stream_context_get_options ($stream_or_context) {}
* </p>
* @return resource A stream context resource.
*/
function stream_context_get_default (array $options = null) {}
function stream_context_get_default (array $options) {}
/**
* Set the default stream context
@ -221,7 +222,8 @@ function stream_context_set_default (array $options) {}
* @return resource|false a resource which can be used to refer to this filter
* instance during a call to stream_filter_remove.
*/
function stream_filter_prepend ($stream, $filter_name, $mode = null, $params = null) {}
function stream_filter_prepend ($stream, string $filter_name, int $mode, mixed $params)
{}
/**
* Attach a filter to a stream
@ -255,7 +257,8 @@ function stream_filter_prepend ($stream, $filter_name, $mode = null, $params = n
* @return resource|false a resource which can be used to refer to this filter
* instance during a call to stream_filter_remove.
*/
function stream_filter_append ($stream, $filter_name, $mode = null, $params = null) {}
function stream_filter_append ($stream, string $filter_name, int $mode, mixed $params)
{}
/**
* Remove a filter from a stream
@ -307,7 +310,7 @@ function stream_filter_remove ($stream_filter) {}
* fwrite, fclose, and
* feof), false on failure.
*/
function stream_socket_client ($address, &$error_code = null, &$error_message = null, $timeout = null, $flags = null, $context = null) {}
function stream_socket_client (string $address, &$error_code, &$error_message, float $timeout, int $flags, $context) {}
/**
* Create an Internet or Unix domain server socket
@ -357,7 +360,7 @@ function stream_socket_client ($address, &$error_code = null, &$error_message =
* </p>
* @return resource|false the created stream, or false on error.
*/
function stream_socket_server ($address, &$error_code = null, &$error_message = null, $flags = null, $context = null) {}
function stream_socket_server (string $address, &$error_code, &$error_message, int $flags, $context) {}
/**
* Accept a connection on a socket created by {@see stream_socket_server}
@ -377,7 +380,7 @@ function stream_socket_server ($address, &$error_code = null, &$error_message =
* </p>
* @return resource|false Returns a stream to the accepted socket connection or FALSE on failure.
*/
function stream_socket_accept ($socket, $timeout = null, &$peer_name = null) {}
function stream_socket_accept ($socket, float $timeout, &$peer_name) {}
/**
* Retrieve the name of the local or remote sockets
@ -391,7 +394,7 @@ function stream_socket_accept ($socket, $timeout = null, &$peer_name = null) {}
* </p>
* @return string|false The name of the socket or false on error.
*/
function stream_socket_get_name ($socket, $remote) {}
function stream_socket_get_name ($socket, bool $remote) {}
/**
* Receives data from a socket, connected or not
@ -430,7 +433,8 @@ function stream_socket_get_name ($socket, $remote) {}
* </p>
* @return string|false the read data, as a string, or false on error
*/
function stream_socket_recvfrom ($socket, $length, $flags = null, &$address = null) {}
function stream_socket_recvfrom ($socket, int $length, int $flags, &$address)
{}
/**
* Sends a message to a socket, whether it is connected or not
@ -463,7 +467,8 @@ function stream_socket_recvfrom ($socket, $length, $flags = null, &$address = nu
* </p>
* @return int|false a result code, as an integer.
*/
function stream_socket_sendto ($socket, $data, $flags = null, $address = null) {}
function stream_socket_sendto ($socket, string $data, int $flags, string $address)
{}
/**
* Turns encryption on/off on an already connected socket
@ -485,7 +490,8 @@ function stream_socket_sendto ($socket, $data, $flags = null, $address = null) {
* 0 if there isn't enough data and you should try again
* (only for non-blocking sockets).
*/
function stream_socket_enable_crypto ($stream, $enable, $crypto_method = null, $session_stream = null) {}
function stream_socket_enable_crypto ($stream, bool $enable, int $crypto_method, $session_stream)
{}
/**
* Shutdown a full-duplex connection
@ -504,7 +510,7 @@ function stream_socket_enable_crypto ($stream, $enable, $crypto_method = null, $
* @return bool true on success or false on failure.
* @since 5.2.1
*/
function stream_socket_shutdown ($stream, $mode) {}
function stream_socket_shutdown ($stream, int $mode) {}
/**
* Creates a pair of connected, indistinguishable socket streams
@ -532,7 +538,7 @@ function stream_socket_shutdown ($stream, $mode) {}
* @return array|false an array with the two socket resources on success, or
* false on failure.
*/
function stream_socket_pair ($domain, $type, $protocol) {}
function stream_socket_pair (int $domain, int $type, int $protocol) {}
/**
* Copies data from one stream to another
@ -551,7 +557,7 @@ function stream_socket_pair ($domain, $type, $protocol) {}
* </p>
* @return int|false the total count of bytes copied, or false on failure.
*/
function stream_copy_to_stream ($from, $to, $length = null, $offset = null) {}
function stream_copy_to_stream ($from, $to, int $length, int $offset) {}
/**
* Reads remainder of a stream into a string
@ -568,7 +574,7 @@ function stream_copy_to_stream ($from, $to, $length = null, $offset = null) {}
* </p>
* @return string|false a string or false on failure.
*/
function stream_get_contents ($stream, $length = -1, $offset = -1) {}
function stream_get_contents ($stream, int $length = -1, int $offset = -1) {}
/**
* Tells whether the stream supports locking.
@ -617,7 +623,7 @@ function stream_supports_lock ($stream) {}
* handle is supplied or false on other errors,
* including end of file.
*/
function fgetcsv ($stream, $length = 0, $separator = ',', $enclosure = '"', $escape = '\\') {}
function fgetcsv ($stream, int $length = 0, string $separator = ',', string $enclosure = '"', string $escape = '\\') {}
/**
* Format line as CSV and write to file pointer
@ -637,7 +643,7 @@ function fgetcsv ($stream, $length = 0, $separator = ',', $enclosure = '"', $esc
* @param string $escape The optional escape_char parameter sets the escape character (one character only).
* @return int|false the length of the written string or false on failure.
*/
function fputcsv ($stream, array $fields, $separator = ",", $enclosure = '"', $escape = "\\") {}
function fputcsv ($stream, array $fields, string $separator = ",", string $enclosure = '"', string $escape = "\\") {}
/**
* Portable advisory file locking
@ -654,7 +660,8 @@ function fputcsv ($stream, array $fields, $separator = ",", $enclosure = '"', $e
* </p>
* @return bool true on success or false on failure.
*/
function flock ($stream, $operation, &$would_block = null) {}
function flock ($stream, int $operation, &$would_block)
{}
/**
* Extracts all meta tag content attributes from a file and returns an array
@ -694,7 +701,8 @@ function flock ($stream, $operation, &$would_block = null) {}
* name, only the last one is returned.
*/
#[Pure]
function get_meta_tags ($filename, $use_include_path = null) {}
function get_meta_tags (string $filename, bool $use_include_path)
{}
/**
* Sets write file buffering on the given stream
@ -711,7 +719,7 @@ function get_meta_tags ($filename, $use_include_path = null) {}
* @return int 0 on success, or EOF if the request cannot be honored.
* @see stream_set_read_buffer()
*/
function stream_set_write_buffer ($stream, $size) {}
function stream_set_write_buffer ($stream, int $size) {}
/**
* Sets read file buffering on the given stream
@ -728,7 +736,7 @@ function stream_set_write_buffer ($stream, $size) {}
* @return int 0 on success, or EOF if the request cannot be honored.
* @see stream_set_write_buffer()
*/
function stream_set_read_buffer ($stream, $size) {}
function stream_set_read_buffer ($stream, int $size) {}
/**
* &Alias; <function>stream_set_write_buffer</function>
@ -742,7 +750,7 @@ function stream_set_read_buffer ($stream, $size) {}
* This ensures that all writes with fwrite() are completed before other processes are allowed to write to that output stream.
* @return int
*/
function set_file_buffer ($stream, $size) {}
function set_file_buffer ($stream, int $size) {}
/**
* &Alias; <function>stream_set_blocking</function>
@ -758,7 +766,7 @@ function set_file_buffer ($stream, $size) {}
* @see stream_set_blocking()
*/
#[Deprecated(replacement: "stream_set_blocking(%parametersList%)", since: 5.3)]
function set_socket_blocking ($socket, $mode) {}
function set_socket_blocking ($socket, bool $mode) {}
/**
* Set blocking/non-blocking mode on a stream
@ -778,7 +786,7 @@ function set_socket_blocking ($socket, $mode) {}
* </p>
* @return bool true on success or false on failure.
*/
function stream_set_blocking ($stream, $enable) {}
function stream_set_blocking ($stream, bool $enable) {}
/**
* &Alias; <function>stream_set_blocking</function>
@ -798,7 +806,7 @@ function stream_set_blocking ($stream, $enable) {}
* </p>
* @return bool true on success or false on failure.
*/
function socket_set_blocking ($stream, $enable) {}
function socket_set_blocking ($stream, bool $enable) {}
/**
* Retrieves header/meta data from streams/file pointers
@ -896,7 +904,8 @@ function stream_get_meta_data ($stream) {}
* <p>
* If an error occurs, returns false.
*/
function stream_get_line ($stream, $length, $ending = null) {}
function stream_get_line ($stream, int $length, string $ending)
{}
/**
* Register a URL wrapper implemented as a PHP class
@ -918,7 +927,8 @@ function stream_get_line ($stream, $length, $ending = null) {}
* stream_wrapper_register will return false if the
* protocol already has a handler.
*/
function stream_wrapper_register ($protocol, $class, $flags = null) {}
function stream_wrapper_register (string $protocol, string $class, int $flags)
{}
/**
* &Alias; <function>stream_wrapper_register</function>
@ -941,7 +951,7 @@ function stream_wrapper_register ($protocol, $class, $flags = null) {}
* stream_wrapper_register will return false if the
* protocol already has a handler.
*/
function stream_register_wrapper ($protocol, $class, $flags = 0) {}
function stream_register_wrapper (string $protocol, string $class, int $flags = 0) {}
/**
* Resolve filename against the include path according to the same rules as fopen()/include().
@ -951,7 +961,7 @@ function stream_register_wrapper ($protocol, $class, $flags = 0) {}
* @return string|false containing the resolved absolute filename, or FALSE on failure.
* @since 5.3.2
*/
function stream_resolve_include_path ($filename) {}
function stream_resolve_include_path (string $filename) {}
/**
* Unregister a URL wrapper
@ -960,7 +970,7 @@ function stream_resolve_include_path ($filename) {}
* </p>
* @return bool true on success or false on failure.
*/
function stream_wrapper_unregister ($protocol) {}
function stream_wrapper_unregister (string $protocol) {}
/**
* Restores a previously unregistered built-in wrapper
@ -969,7 +979,7 @@ function stream_wrapper_unregister ($protocol) {}
* </p>
* @return bool true on success or false on failure.
*/
function stream_wrapper_restore ($protocol) {}
function stream_wrapper_restore (string $protocol) {}
/**
* Retrieve list of registered streams
@ -1016,7 +1026,8 @@ function stream_is_local ($stream) {}
* failure.
*/
#[Pure]
function get_headers ($url, $associative = null, $context = null) {}
function get_headers (string $url, bool $associative, $context)
{}
/**
* Set timeout period on a stream
@ -1032,7 +1043,8 @@ function get_headers ($url, $associative = null, $context = null) {}
* </p>
* @return bool true on success or false on failure.
*/
function stream_set_timeout ($stream, $seconds, $microseconds = null) {}
function stream_set_timeout ($stream, int $seconds, int $microseconds)
{}
/**
* &Alias; <function>stream_set_timeout</function>
@ -1049,7 +1061,7 @@ function stream_set_timeout ($stream, $seconds, $microseconds = null) {}
* </p>
* @return bool true on success or false on failure.
*/
function socket_set_timeout ($stream, $seconds, $microseconds = 0) {}
function socket_set_timeout ($stream, int $seconds, int $microseconds = 0) {}
/**
* &Alias; <function>stream_get_meta_data</function>
@ -1130,7 +1142,7 @@ function socket_get_status ($stream) {}
* the file does not exist.
*/
#[Pure]
function realpath ($path) {}
function realpath (string $path) {}
/**
* Match filename against a pattern
@ -1188,5 +1200,6 @@ function realpath ($path) {}
* </p>
* @return bool true if there is a match, false otherwise.
*/
function fnmatch ($pattern, $filename, $flags = null) {}
function fnmatch (string $pattern, string $filename, int $flags)
{}
?>

View File

@ -46,7 +46,7 @@ use JetBrains\PhpStorm\Pure;
* fwrite, fclose, and
* feof). If the call fails, it will return false
*/
function fsockopen ($hostname, $port = null, &$error_code = null, &$error_message = null, $timeout = null) {}
function fsockopen (string $hostname, int $port, &$error_code, &$error_message, float $timeout) {}
/**
* Open persistent Internet or Unix domain socket connection
@ -59,7 +59,7 @@ function fsockopen ($hostname, $port = null, &$error_code = null, &$error_messag
* @param float $timeout [optional]
* @return resource|false
*/
function pfsockopen ($hostname, $port = null, &$error_code = null, &$error_message = null, $timeout = null) {}
function pfsockopen (string $hostname, int $port, &$error_code, &$error_message, float $timeout) {}
/**
* Pack data into binary string
@ -166,7 +166,7 @@ function pfsockopen ($hostname, $port = null, &$error_code = null, &$error_messa
* @return string|false a binary string containing data or false if the format string contains errors
*/
#[Pure]
function pack ($format, ...$values) {}
function pack (string $format, ...$values) {}
/**
* Unpack data from binary string
@ -182,7 +182,7 @@ function pack ($format, ...$values) {}
* string or false if the format string contains errors
*/
#[Pure]
function unpack ($format, $string, $offset = 0) {}
function unpack (string $format, string $string, int $offset = 0) {}
/**
* Tells what the user's browser is capable of
@ -212,29 +212,7 @@ function unpack ($format, $string, $offset = 0) {}
* reload, and check for the value.
*/
#[Pure]
function get_browser ($user_agent = null, $return_array = null) {}
#[PhpStormStubsElementAvailable('8.0')]
/**
* One-way string encryption (hashing)
* @link https://php.net/manual/en/function.crypt.php
* @param string $string <p>
* The string to be encrypted.
* </p>
* @param string $salt <p>
* An optional salt string to base the encryption on. If not provided,
* one will be randomly generated by PHP each time you call this function.
* PHP 5.6 or later raise E_NOTICE error if this parameter is omitted
* </p>
* <p>
* If you are using the supplied salt, you should be aware that the salt
* 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
*/
#[Pure]
function crypt ($string, $salt) {}
function get_browser (string $user_agent, bool $return_array) {}
#[PhpStormStubsElementAvailable(to: '7.4')]
/**
@ -256,7 +234,30 @@ function crypt ($string, $salt) {}
* @return string|null the encrypted string or <b>NULL</b> if an error occurs
*/
#[Pure]
function crypt ($string, $salt = null) {}
function crypt ($string, $salt = null)
{}
#[PhpStormStubsElementAvailable('8.0')]
/**
* One-way string encryption (hashing)
* @link https://php.net/manual/en/function.crypt.php
* @param string $string <p>
* The string to be encrypted.
* </p>
* @param string $salt <p>
* An optional salt string to base the encryption on. If not provided,
* one will be randomly generated by PHP each time you call this function.
* PHP 5.6 or later raise E_NOTICE error if this parameter is omitted
* </p>
* <p>
* If you are using the supplied salt, you should be aware that the salt
* 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
*/
#[Pure]
function crypt (string $string, string $salt) {}
/**
* Open directory handle
@ -282,7 +283,8 @@ function crypt ($string, $salt = null) {}
* '@' to the
* front of the function name.
*/
function opendir ($directory, $context = null) {}
function opendir (string $directory, $context)
{}
/**
* Close directory handle
@ -295,7 +297,7 @@ function opendir ($directory, $context = null) {}
* </p>
* @return void
*/
function closedir ($dir_handle = null) {}
function closedir ($dir_handle) {}
/**
* Change directory
@ -305,7 +307,7 @@ function closedir ($dir_handle = null) {}
* </p>
* @return bool true on success or false on failure.
*/
function chdir ($directory) {}
function chdir (string $directory) {}
/**
* Change the root directory
@ -315,7 +317,7 @@ function chdir ($directory) {}
* </p>
* @return bool true on success or false on failure.
*/
function chroot ($directory) {}
function chroot (string $directory) {}
/**
* Gets the current working directory
@ -345,7 +347,7 @@ function getcwd () {}
* </p>
* @return void
*/
function rewinddir ($dir_handle = null) {}
function rewinddir ($dir_handle) {}
/**
* Read entry from directory handle
@ -358,7 +360,7 @@ function rewinddir ($dir_handle = null) {}
* </p>
* @return string|false the filename on success or false on failure.
*/
function readdir ($dir_handle = null) {}
function readdir ($dir_handle) {}
/**
* Return an instance of the Directory class
@ -370,7 +372,7 @@ function readdir ($dir_handle = null) {}
* @return Directory|null|false an instance of Directory, or <b>NULL</b> with wrong
* parameters, or <b>FALSE</b> in case of another error
*/
function dir ($directory, $context = null) {}
function dir (string $directory, $context) {}
/**
* Alias of dir()
@ -379,7 +381,7 @@ function dir ($directory, $context = null) {}
* @return Directory|false
* @see dir()
*/
function getdir(string $directory, $context = null) {}
function getdir(string $directory, $context) {}
/**
* List files and directories inside the specified path
@ -402,7 +404,8 @@ function getdir(string $directory, $context = null) {}
* boolean false is returned, and an error of level
* E_WARNING is generated.
*/
function scandir ($directory, $sorting_order = null, $context = null) {}
function scandir (string $directory, int $sorting_order, $context)
{}
/**
* Find pathnames matching a pattern
@ -427,7 +430,8 @@ function scandir ($directory, $sorting_order = null, $context = null) {}
* error.
*/
#[Pure]
function glob ($pattern, $flags = null) {}
function glob (string $pattern, int $flags)
{}
/**
* Gets last access time of file
@ -439,7 +443,7 @@ function glob ($pattern, $flags = null) {}
* The time is returned as a Unix timestamp.
*/
#[Pure]
function fileatime ($filename) {}
function fileatime (string $filename) {}
/**
* Gets inode change time of file
@ -451,7 +455,7 @@ function fileatime ($filename) {}
* The time is returned as a Unix timestamp.
*/
#[Pure]
function filectime ($filename) {}
function filectime (string $filename) {}
/**
* Gets file group
@ -465,7 +469,7 @@ function filectime ($filename) {}
* Upon failure, false is returned.
*/
#[Pure]
function filegroup ($filename) {}
function filegroup (string $filename) {}
/**
* Gets file inode
@ -476,7 +480,7 @@ function filegroup ($filename) {}
* @return int|false the inode number of the file, or false on failure.
*/
#[Pure]
function fileinode ($filename) {}
function fileinode (string $filename) {}
/**
* Gets file modification time
@ -489,7 +493,7 @@ function fileinode ($filename) {}
* suitable for the date function.
*/
#[Pure]
function filemtime ($filename) {}
function filemtime (string $filename) {}
/**
* Gets file owner
@ -502,7 +506,7 @@ function filemtime ($filename) {}
* posix_getpwuid to resolve it to a username.
*/
#[Pure]
function fileowner ($filename) {}
function fileowner (string $filename) {}
/**
* Gets file permissions
@ -513,7 +517,7 @@ function fileowner ($filename) {}
* @return int|false the permissions on the file, or false on failure.
*/
#[Pure]
function fileperms ($filename) {}
function fileperms (string $filename) {}
/**
* Gets file size
@ -525,7 +529,7 @@ function fileperms ($filename) {}
* of level E_WARNING) in case of an error.
*/
#[Pure]
function filesize ($filename) {}
function filesize (string $filename) {}
/**
* Gets file type
@ -542,7 +546,7 @@ function filesize ($filename) {}
* or if the file type is unknown.
*/
#[Pure]
function filetype ($filename) {}
function filetype (string $filename) {}
/**
* Checks whether a file or directory exists
@ -571,7 +575,7 @@ function filetype ($filename) {}
* The check is done using the real UID/GID instead of the effective one.
*/
#[Pure]
function file_exists ($filename) {}
function file_exists (string $filename) {}
/**
* Tells whether the filename is writable
@ -583,7 +587,7 @@ function file_exists ($filename) {}
* writable.
*/
#[Pure]
function is_writable ($filename) {}
function is_writable (string $filename) {}
/**
* &Alias; <function>is_writable</function>
@ -595,7 +599,7 @@ function is_writable ($filename) {}
* writable.
*/
#[Pure]
function is_writeable ($filename) {}
function is_writeable (string $filename) {}
/**
* Tells whether a file or a directory exists and is readable
@ -607,7 +611,7 @@ function is_writeable ($filename) {}
* filename exists and is readable, false otherwise.
*/
#[Pure]
function is_readable ($filename) {}
function is_readable (string $filename) {}
/**
* Tells whether the filename is executable
@ -619,7 +623,7 @@ function is_readable ($filename) {}
* error.
*/
#[Pure]
function is_executable ($filename) {}
function is_executable (string $filename) {}
/**
* Tells whether the filename is a regular file
@ -631,7 +635,7 @@ function is_executable ($filename) {}
* otherwise.
*/
#[Pure]
function is_file ($filename) {}
function is_file (string $filename) {}
/**
* Tells whether the filename is a directory
@ -646,7 +650,7 @@ function is_file ($filename) {}
* otherwise.
*/
#[Pure]
function is_dir ($filename) {}
function is_dir (string $filename) {}
/**
* Tells whether the filename is a symbolic link
@ -658,7 +662,7 @@ function is_dir ($filename) {}
* otherwise.
*/
#[Pure]
function is_link ($filename) {}
function is_link (string $filename) {}
/**
* Gives information about a file
@ -750,7 +754,7 @@ function is_link ($filename) {}
* In case of error, stat returns false.
*/
#[Pure]
function stat ($filename) {}
function stat (string $filename) {}
/**
* Gives information about a file or symbolic link
@ -767,7 +771,7 @@ function stat ($filename) {}
* file pointed to by the symbolic link.
*/
#[Pure]
function lstat ($filename) {}
function lstat (string $filename) {}
/**
* Changes file owner
@ -775,12 +779,12 @@ function lstat ($filename) {}
* @param string $filename <p>
* Path to the file.
* </p>
* @param mixed $user <p>
* @param string|int $user <p>
* A user name or number.
* </p>
* @return bool true on success or false on failure.
*/
function chown ($filename, $user) {}
function chown (string $filename, string|int $user) {}
/**
* Changes file group
@ -788,12 +792,12 @@ function chown ($filename, $user) {}
* @param string $filename <p>
* Path to the file.
* </p>
* @param mixed $group <p>
* @param string|int $group <p>
* A group name or number.
* </p>
* @return bool true on success or false on failure.
*/
function chgrp ($filename, $group) {}
function chgrp (string $filename, string|int $group) {}
/**
* Changes user ownership of symlink
@ -801,13 +805,13 @@ function chgrp ($filename, $group) {}
* @param string $filename <p>
* Path to the file.
* </p>
* @param mixed $user <p>
* @param string|int $user <p>
* User name or number.
* </p>
* @return bool true on success or false on failure.
* @since 5.1.2
*/
function lchown ($filename, $user) {}
function lchown (string $filename, string|int $user) {}
/**
* Changes group ownership of symlink
@ -815,13 +819,13 @@ function lchown ($filename, $user) {}
* @param string $filename <p>
* Path to the symlink.
* </p>
* @param mixed $group <p>
* @param string|int $group <p>
* The group specified by name or number.
* </p>
* @return bool true on success or false on failure.
* @since 5.1.2
*/
function lchgrp ($filename, $group) {}
function lchgrp (string $filename, string|int $group) {}
/**
* Changes file mode
@ -857,7 +861,7 @@ function lchgrp ($filename, $group) {}
* <p>
* @return bool true on success or false on failure.
*/
function chmod ($filename, $permissions) {}
function chmod (string $filename, int $permissions) {}
/**
* Sets access and modification time of file
@ -876,7 +880,8 @@ function chmod ($filename, $permissions) {}
* </p>
* @return bool true on success or false on failure.
*/
function touch ($filename, $mtime = null, $atime = null) {}
function touch (string $filename, int $mtime, int $atime)
{}
/**
* Clears file status cache
@ -890,7 +895,7 @@ function touch ($filename, $mtime = null, $atime = null) {}
* </p>
* @return void
*/
function clearstatcache ($clear_realpath_cache = null, $filename = null) {}
function clearstatcache (bool $clear_realpath_cache, string $filename) {}
/**
* Returns the total size of a filesystem or disk partition
@ -901,7 +906,7 @@ function clearstatcache ($clear_realpath_cache = null, $filename = null) {}
* @return float|false the total number of bytes as a float
* or false on failure.
*/
function disk_total_space ($directory) {}
function disk_total_space (string $directory) {}
/**
* Returns available space in directory
@ -918,7 +923,7 @@ function disk_total_space ($directory) {}
* or false on failure.
*/
#[Pure]
function disk_free_space ($directory) {}
function disk_free_space (string $directory) {}
/**
* Alias of {@see disk_free_space}
@ -928,7 +933,7 @@ function disk_free_space ($directory) {}
* @return float|false
*/
#[Pure]
function diskfreespace ($directory) {}
function diskfreespace (string $directory) {}
/**
* Send mail
@ -1016,7 +1021,8 @@ function diskfreespace ($directory) {}
* It is important to note that just because the mail was accepted for delivery,
* it does NOT mean the mail will actually reach the intended destination.
*/
function mail ($to, $subject, $message, $additional_headers = null, $additional_params = null) {}
function mail (string $to, string $subject, string $message, array|string $additional_headers, string $additional_params)
{}
/**
* Calculate the hash value needed by EZMLM
@ -1028,7 +1034,7 @@ function mail ($to, $subject, $message, $additional_headers = null, $additional_
* @removed 8.0
*/
#[Deprecated(since: '7.4')]
function ezmlm_hash ($addr) {}
function ezmlm_hash (string $addr) {}
/**
* Open connection to system logger
@ -1150,6 +1156,6 @@ function ezmlm_hash ($addr) {}
* </p>
* @return bool true on success or false on failure.
*/
function openlog ($prefix, $flags, $facility) {}
function openlog (string $prefix, int $flags, int $facility) {}
?>

View File

@ -58,7 +58,7 @@ use JetBrains\PhpStorm\Pure;
* </p>
* @return bool true on success or false on failure.
*/
function syslog ($priority, $message) {}
function syslog (int $priority, string $message) {}
/**
* Close connection to system logger
@ -94,19 +94,23 @@ function header_register_callback ( callable $callback ) {}
* Index 3 is a text string with the correct <b>height="yyy" width="xxx"</b> string<br>
* that can be used directly in an IMG tag.<br>
* On failure, FALSE is returned.
* @link https://secure.php.net/manual/en/function.getimagesizefromstring.php
* @since 5.4
*/
function getimagesizefromstring ($string , array &$image_info = null) {}
function getimagesizefromstring (string $string , &$image_info)
{}
/**
* Set the stream chunk size.
* @since 5.4
* @link https://secure.php.net/manual/en/function.stream-set-chunk-size.php
* @param resource $stream The target stream.
* @param int $size The desired new chunk size.
* @return int|false Returns the previous chunk size on success.<br>
* Will return <b>FALSE</b> if chunk_size is less than 1 or greater than <b>PHP_INT_MAX</b>.
* @link https://secure.php.net/manual/en/function.stream-set-chunk-size.php
* @since 5.4
*/
function stream_set_chunk_size ($stream , $size) {}
function stream_set_chunk_size ($stream , int $size)
{}
/**
* Initializes all syslog related variables
@ -137,7 +141,7 @@ function lcg_value () {}
* @return string|false the metaphone key as a string, or FALSE on failure
*/
#[Pure]
function metaphone ($string, $max_phonemes = 0) {}
function metaphone (string $string, int $max_phonemes = 0) {}
/**
* Turn on output buffering
@ -204,7 +208,7 @@ function metaphone ($string, $max_phonemes = 0) {}
* </p>
* @return bool true on success or false on failure.
*/
function ob_start ($callback = null, $chunk_size = null, $flags = PHP_OUTPUT_HANDLER_STDFLAGS) {}
function ob_start ($callback, int $chunk_size, int $flags = PHP_OUTPUT_HANDLER_STDFLAGS) {}
/**
* Flush (send) the output buffer
@ -338,7 +342,7 @@ function ob_get_level () {}
* <tr><td>blocksize</td><td>...</td></tr>
* </table>
*/
function ob_get_status ($full_status = null) {}
function ob_get_status (bool $full_status) {}
/**
* Return the contents of the output buffer
@ -382,7 +386,7 @@ function ob_list_handlers () {}
* </p>
* @return bool true on success or false on failure.
*/
function ksort (array &$array, $flags = null) {}
function ksort (array &$array, int $flags) {}
/**
* Sort an array by key in reverse order
@ -397,7 +401,7 @@ function ksort (array &$array, $flags = null) {}
* </p>
* @return bool true on success or false on failure.
*/
function krsort (array &$array, $flags = null) {}
function krsort (array &$array, int $flags) {}
/**
* Sort an array using a "natural order" algorithm
@ -432,7 +436,7 @@ function natcasesort (array &$array) {}
* </p>
* @return bool true on success or false on failure.
*/
function asort (array &$array, $flags = null) {}
function asort (array &$array, int $flags) {}
/**
* Sort an array in reverse order and maintain index association
@ -447,7 +451,7 @@ function asort (array &$array, $flags = null) {}
* </p>
* @return bool true on success or false on failure.
*/
function arsort (array &$array, $flags = null) {}
function arsort (array &$array, int $flags) {}
/**
* Sort an array
@ -465,7 +469,7 @@ function arsort (array &$array, $flags = null) {}
* (don't change types)
* @return bool true on success or false on failure.
*/
function sort (array &$array, $flags = null) {}
function sort (array &$array, int $flags) {}
/**
* Sort an array in reverse order
@ -480,7 +484,7 @@ function sort (array &$array, $flags = null) {}
* </p>
* @return bool true on success or false on failure.
*/
function rsort (array &$array, $flags = null) {}
function rsort (array &$array, int $flags) {}
/**
* Sort an array by values using a user-defined comparison function
@ -495,7 +499,7 @@ function rsort (array &$array, $flags = null) {}
* </p>
* @return bool true on success or false on failure.
*/
function usort (array &$array, $callback) {}
function usort (array &$array, callable $callback) {}
/**
* Sort an array with a user-defined comparison function and maintain index association
@ -509,7 +513,7 @@ function usort (array &$array, $callback) {}
* </p>
* @return bool true on success or false on failure.
*/
function uasort (array &$array, $callback) {}
function uasort (array &$array, callable $callback) {}
/**
* Sort an array by keys using a user-defined comparison function
@ -530,7 +534,7 @@ function uasort (array &$array, $callback) {}
* </p>
* @return bool true on success or false on failure.
*/
function uksort (array &$array, $callback) {}
function uksort (array &$array, callable $callback) {}
/**
* Shuffle an array
@ -574,7 +578,8 @@ function shuffle (array &$array) {}
* </p>
* @return bool true on success or false on failure.
*/
function array_walk (array &$array, $callback, $arg = null) {}
function array_walk (object|array &$array, callable $callback, mixed $arg)
{}
/**
* Apply a user function recursively to every member of an array
@ -602,7 +607,8 @@ function array_walk (array &$array, $callback, $arg = null) {}
* </p>
* @return bool true on success or false on failure.
*/
function array_walk_recursive (array &$array, $callback, $arg = null) {}
function array_walk_recursive (object|array &$array, callable $callback, mixed $arg)
{}
/**
* Counts all elements in an array, or something in an object.
@ -610,7 +616,7 @@ function array_walk_recursive (array &$array, $callback, $arg = null) {}
* The interface has exactly one method, {@see Countable::count()}, which returns the return value for the count() function.
* Please see the {@see Array} section of the manual for a detailed explanation of how arrays are implemented and used in PHP.
* @link https://php.net/manual/en/function.count.php
* @param array|Countable $value The array or the object.
* @param array|Countable $value The array or the object.
* @param int $mode [optional] If the optional mode parameter is set to
* COUNT_RECURSIVE (or 1), count
* will recursively count the array. This is particularly useful for
@ -632,7 +638,7 @@ function array_walk_recursive (array &$array, $callback, $arg = null) {}
* empty array. Use isset to test if a variable is set.
*/
#[Pure]
function count ($value, $mode = COUNT_NORMAL) {}
function count (Countable|array $value, int $mode = COUNT_NORMAL) {}
/**
* Set the internal pointer of an array to its last element
@ -646,7 +652,7 @@ function count ($value, $mode = COUNT_NORMAL) {}
* @return mixed|false the value of the last element or false for empty array.
* @meta
*/
function end (&$array) {}
function end (object|array &$array) {}
/**
* Rewind the internal array pointer
@ -659,7 +665,7 @@ function end (&$array) {}
* elements.
* @meta
*/
function prev (&$array) {}
function prev (object|array &$array) {}
/**
* Advance the internal array pointer of an array
@ -671,7 +677,7 @@ function prev (&$array) {}
* internal array pointer, or false if there are no more elements.
* @meta
*/
function next (&$array) {}
function next (object|array &$array) {}
/**
* Set the internal pointer of an array to its first element
@ -683,7 +689,7 @@ function next (&$array) {}
* empty.
* @meta
*/
function reset (&$array) {}
function reset (object|array &$array) {}
/**
* Return the current element in an array
@ -699,7 +705,7 @@ function reset (&$array) {}
* @meta
*/
#[Pure]
function current ($array) {}
function current (object|array $array) {}
/**
* Fetch a key from an array
@ -714,7 +720,7 @@ function current ($array) {}
* empty, key returns null.
*/
#[Pure]
function key ($array) {}
function key (object|array $array) {}
/**
* Find lowest value
@ -725,7 +731,7 @@ function key ($array) {}
* parameter values.
*/
#[Pure]
function min ($value, ...$values) {}
function min (mixed $value, mixed ...$values) {}
/**
* Find highest value
@ -736,7 +742,7 @@ function min ($value, ...$values) {}
* parameter values, either within a arg array or two arguments.
*/
#[Pure]
function max ($value, ...$values) {}
function max (mixed $value, mixed ...$values) {}
/**
* Checks if a value exists in an array
@ -761,7 +767,7 @@ function max ($value, ...$values) {}
* false otherwise.
*/
#[Pure]
function in_array ($needle, array $haystack, $strict = false) {}
function in_array (mixed $needle, array $haystack, bool $strict = false) {}
/**
* Searches the array for a given value and returns the first corresponding key if successful
@ -792,7 +798,8 @@ function in_array ($needle, array $haystack, $strict = false) {}
* search_value parameter instead.
*/
#[Pure]
function array_search ($needle, array $haystack, $strict = null) {}
function array_search (mixed $needle, array $haystack, bool $strict)
{}
/**
* Import variables into the current symbol table from an array
@ -820,7 +827,7 @@ function array_search ($needle, array $haystack, $strict = null) {}
* @return int the number of variables successfully imported into the symbol
* table.
*/
function extract (array $array, $flags = null, $prefix = null) {}
function extract (array $array, int $flags, string $prefix) {}
/**
* Create array containing variables and their values
@ -836,7 +843,7 @@ function extract (array $array, $flags = null, $prefix = null) {}
* @return array the output array with all the variables added to it.
*/
#[Pure]
function compact ($var_name, ...$var_names) {}
function compact (mixed $var_name, ...$var_names) {}
/**
* Fill an array with values
@ -854,7 +861,7 @@ function compact ($var_name, ...$var_names) {}
* @return array the filled array
*/
#[Pure]
function array_fill ($start_index, $count, $value) {}
function array_fill (int $start_index, int $count, mixed $value) {}
/**
* Fill an array with values, specifying keys
@ -869,7 +876,7 @@ function array_fill ($start_index, $count, $value) {}
* @return array the filled array
*/
#[Pure]
function array_fill_keys (array $keys, $value) {}
function array_fill_keys (array $keys, mixed $value) {}
/**
* Create an array containing a range of elements
@ -890,7 +897,8 @@ function array_fill_keys (array $keys, $value) {}
* end, inclusive.
*/
#[Pure]
function range ($start, $end, $step = 1) {}
function range ($start, $end, int|float $step = 1)
{}
/**
* Sort multiple or multi-dimensional arrays
@ -905,7 +913,7 @@ function range ($start, $end, $step = 1) {}
* </p>
* @return bool true on success or false on failure.
*/
function array_multisort (array &$array, &...$rest) {}
function array_multisort (&$array, &...$rest) {}
/**
* Push elements onto the end of array
@ -1006,7 +1014,8 @@ function array_unshift (array &$array, ...$values) {}
* </p>
* @return array the array consisting of the extracted elements.
*/
function array_splice (array &$array, $offset, $length = null, $replacement = null) {}
function array_splice (array &$array, int $offset, int $length, mixed $replacement)
{}
/**
* Extract a slice of the array
@ -1038,7 +1047,8 @@ function array_splice (array &$array, $offset, $length = null, $replacement = nu
* @meta
*/
#[Pure]
function array_slice (array $array, $offset, $length = null, $preserve_keys = false) {}
function array_slice (array $array, int $offset, int $length, bool $preserve_keys = false)
{}
/**
* Merge one or more arrays

View File

@ -73,7 +73,7 @@ function array_replace_recursive(array $array, array ...$replacements) { }
* @return array an array of all the keys in input.
*/
#[Pure]
function array_keys(array $array, $filter_value = null, $strict = null) { }
function array_keys(array $array, mixed $filter_value, bool $strict) { }
/**
* Return all the values of an array
@ -104,13 +104,13 @@ function array_count_values(array $array) { }
* Return the values from a single column in the input array
* @link https://secure.php.net/manual/en/function.array-column.php
* @param array $array <p>A multi-dimensional array (record set) from which to pull a column of values.</p>
* @param mixed $column_key <p>The column of values to return. This value may be the integer key of the column you wish to retrieve, or it may be the string key name for an associative array. It may also be NULL to return complete arrays (useful together with index_key to reindex the array).</p>
* @param string|int|null $column_key <p>The column of values to return. This value may be the integer key of the column you wish to retrieve, or it may be the string key name for an associative array. It may also be NULL to return complete arrays (useful together with index_key to reindex the array).</p>
* @param mixed $index_key [optional] <p>The column to use as the index/keys for the returned array. This value may be the integer key of the column, or it may be the string key name.</p>
* @return array Returns an array of values representing a single column from the input array.
* @since 5.5
*/
#[Pure]
function array_column(array $array, $column_key, $index_key = null) { }
function array_column(array $array, string|int|null $column_key, string|int $index_key = null) { }
/**
* Return an array with elements in reverse order
@ -125,7 +125,7 @@ function array_column(array $array, $column_key, $index_key = null) { }
* @meta
*/
#[Pure]
function array_reverse(array $array, $preserve_keys = null) { }
function array_reverse(array $array, bool $preserve_keys) { }
/**
* Iteratively reduce the array to a single value using a callback function
@ -157,7 +157,7 @@ function array_reverse(array $array, $preserve_keys = null) { }
* <br/>
* @meta
*/
function array_reduce(array $array, $callback, $initial = null) { }
function array_reduce(array $array, callable $callback, mixed $initial) { }
/**
* Pad array to the specified length with a value
@ -180,7 +180,7 @@ function array_reduce(array $array, $callback, $initial = null) { }
* the length of the input then no padding takes place.
*/
#[Pure]
function array_pad(array $array, $length, $value) { }
function array_pad(array $array, int $length, mixed $value) { }
/**
* Exchanges all keys with their associated values in an array
@ -207,7 +207,7 @@ function array_flip(array $array) { }
* @meta
*/
#[Pure]
function array_change_key_case(array $array, $case = null) { }
function array_change_key_case(array $array, int $case) { }
/**
* Pick one or more random keys out of an array
@ -224,7 +224,7 @@ function array_change_key_case(array $array, $case = null) { }
* random keys as well as values out of the array.
*/
#[Pure]
function array_rand(array $array, $num = null) { }
function array_rand(array $array, int $num) { }
/**
* Removes duplicate values from an array
@ -258,7 +258,7 @@ function array_rand(array $array, $num = null) { }
* @meta
*/
#[Pure]
function array_unique(array $array, $flags = SORT_STRING) { }
function array_unique(array $array, int $flags = SORT_STRING) { }
#[PhpStormStubsElementAvailable('8.0')]
/**
@ -330,7 +330,7 @@ function array_intersect_key(array $array1, array $array2, array ...$_) { }
* in all the arguments.
* @meta
*/
function array_intersect_ukey(array $array1, array $array2, array $_ = null, $key_compare_func) { }
function array_intersect_ukey(array $array1, array $array2, array $_ = null, callable $key_compare_func) { }
/**
* Computes the intersection of arrays, compares data by a callback function
@ -355,7 +355,7 @@ function array_intersect_ukey(array $array1, array $array2, array $_ = null, $ke
* that are present in all the arguments.
* @meta
*/
function array_uintersect(array $array1, array $array2, array $_ = null, $data_compare_func) { }
function array_uintersect(array $array1, array $array2, array $_ = null, callable $data_compare_func) { }
/**
* Computes the intersection of arrays with additional index check
@ -395,7 +395,7 @@ function array_intersect_assoc(array $array1, array $array2, array $_ = null) {
* array1 that are present in all the arguments.
* @meta
*/
function array_uintersect_assoc(array $array1, array $array2, array $_ = null, $data_compare_func) { }
function array_uintersect_assoc(array $array1, array $array2, array $_ = null, callable $data_compare_func) { }
/**
* Computes the intersection of arrays with additional index check, compares indexes by a callback function
@ -414,7 +414,7 @@ function array_uintersect_assoc(array $array1, array $array2, array $_ = null, $
* in all of the arguments.
* @meta
*/
function array_intersect_uassoc(array $array1, array $array2, array $_ = null, $key_compare_func) { }
function array_intersect_uassoc(array $array1, array $array2, array $_ = null, callable $key_compare_func) { }
/**
* Computes the intersection of arrays with additional index check, compares data and indexes by separate callback functions
@ -441,7 +441,7 @@ function array_intersect_uassoc(array $array1, array $array2, array $_ = null, $
* @meta
*/
#[Pure]
function array_uintersect_uassoc(array $array1, array $array2, array $_ = null, $data_compare_func, $key_compare_func) { }
function array_uintersect_uassoc(array $array1, array $array2, array $_ = null, callable $data_compare_func, callable $key_compare_func) { }
#[PhpStormStubsElementAvailable('8.0')]
/**
@ -515,7 +515,7 @@ function array_diff_key(array $array1, array $array2, array ...$_) { }
* array1 that are not present in any of the other arrays.
* @meta
*/
function array_diff_ukey(array $array1, array $array2, array $_ = null, $key_compare_func) { }
function array_diff_ukey(array $array1, array $array2, array $_ = null, callable $key_compare_func) { }
/**
* Computes the difference of arrays by using a callback function for data comparison
@ -540,7 +540,7 @@ function array_diff_ukey(array $array1, array $array2, array $_ = null, $key_com
* that are not present in any of the other arguments.
* @meta
*/
function array_udiff(array $array1, array $array2, array $_ = null, $data_compare_func) { }
function array_udiff(array $array1, array $array2, array $_ = null, callable $data_compare_func) { }
/**
* Computes the difference of arrays with additional index check
@ -589,7 +589,7 @@ function array_diff_assoc(array $array1, array $array2, array ...$_) { }
* comparison.
* @meta
*/
function array_udiff_assoc(array $array1, array $array2, array $_ = null, $data_compare_func) { }
function array_udiff_assoc(array $array1, array $array2, array $_ = null, callable $data_compare_func) { }
/**
* Computes the difference of arrays with additional index check which is performed by a user supplied callback function
@ -611,7 +611,7 @@ function array_udiff_assoc(array $array1, array $array2, array $_ = null, $data_
* array1 that are not present in any of the other arrays.
* @meta
*/
function array_diff_uassoc(array $array1, array $array2, array $_ = null, $key_compare_func) { }
function array_diff_uassoc(array $array1, array $array2, array $_ = null, callable $key_compare_func) { }
/**
* Computes the difference of arrays with additional index check, compares data and indexes by a callback function
@ -650,7 +650,7 @@ function array_diff_uassoc(array $array1, array $array2, array $_ = null, $key_c
* arguments.
* @meta
*/
function array_udiff_uassoc(array $array1, array $array2, array $_ = null, $data_compare_func, $key_compare_func) { }
function array_udiff_uassoc(array $array1, array $array2, array $_ = null, callable $data_compare_func, callable $key_compare_func) { }
/**
* Calculate the sum of values in an array
@ -708,7 +708,7 @@ function array_product(array $array) { }
* @return array the filtered array.
* @meta
*/
function array_filter(array $array, $callback = null, $mode = 0) { }
function array_filter(array $array, callable $callback, int $mode = 0) { }
/**
* Applies the callback to the elements of the given arrays
@ -724,7 +724,7 @@ function array_filter(array $array, $callback = null, $mode = 0) { }
* after applying the callback function to each one.
* @meta
*/
function array_map($callback, array $array, array ...$arrays) { }
function array_map(callable $callback, array $array, array ...$arrays) { }
/**
* Split an array into chunks
@ -743,7 +743,8 @@ function array_map($callback, array $array, array ...$arrays) { }
* with each dimension containing size elements.
*/
#[Pure]
function array_chunk(array $array, $length, $preserve_keys = null) { }
function array_chunk(array $array, int $length, bool $preserve_keys)
{ }
/**
* Creates an array by using one array for keys and another for its values
@ -774,7 +775,8 @@ function array_combine(array $keys, array $values) { }
* @return bool true on success or false on failure.
*/
#[Pure]
function array_key_exists($key, array $array) { }
function array_key_exists($key, array $array)
{ }
/**
* Gets the first key of an array
@ -805,11 +807,11 @@ function array_key_last(array $array) { }
/**
* &Alias; <function>current</function>
* @link https://php.net/manual/en/function.pos.php
* @param array $array
* @param array|ArrayAccess $array
* @return mixed
*/
#[Pure]
function pos($array) { }
function pos(object|array $array) { }
/**
* &Alias; <function>count</function>
@ -819,7 +821,7 @@ function pos($array) { }
* @return int
*/
#[Pure]
function sizeof($value, $mode = COUNT_NORMAL) { }
function sizeof(Countable|array $value, int $mode = COUNT_NORMAL) { }
/**
* Checks if the given key or index exists in the array. The name of this function is array_key_exists() in PHP > 4.0.6.
@ -833,12 +835,12 @@ function sizeof($value, $mode = COUNT_NORMAL) { }
* @return bool true on success or false on failure.
*/
#[Pure]
function key_exists($key, $array) { }
function key_exists($key, array $array) { }
/**
* Checks if assertion is &false;
* @link https://php.net/manual/en/function.assert.php
* @param mixed $assertion <p>
* @param Throwable|string|null $assertion <p>
* The assertion.
* In PHP 5, this must be either a string to be evaluated or a boolean to be tested.
* In PHP 7, this may also be any expression that returns a value,
@ -849,7 +851,7 @@ function key_exists($key, $array) { }
* <p>An optional description that will be included in the failure message if the assertion fails.</p>
* @return bool false if the assertion is false, true otherwise.
*/
function assert($assertion, $description = '') { }
function assert(mixed $assertion, $description = '') { }
/**
* AssertionError is thrown when an assertion made via {@see assert()} fails.
@ -912,7 +914,7 @@ class AssertionError extends Error {
* </p>
* @return mixed|false the original setting of any option or false on errors.
*/
function assert_options($option, $value = null) { }
function assert_options(int $option, mixed $value) { }
/**
* Compares two "PHP-standardized" version number strings
@ -948,7 +950,8 @@ function assert_options($option, $value = null) { }
* function will return true if the relationship is the one specified
* by the operator, false otherwise.
*/
function version_compare($version1, $version2, $operator = null) { }
function version_compare(string $version1, string $version2, string $operator)
{ }
/**
* Convert a pathname and a project identifier to a System V IPC key
@ -963,7 +966,7 @@ function version_compare($version1, $version2, $operator = null) { }
* -1 is returned.
*/
#[Pure]
function ftok($filename, $project_id) { }
function ftok(string $filename, string $project_id) { }
/**
* Perform the rot13 transform on a string
@ -974,7 +977,7 @@ function ftok($filename, $project_id) { }
* @return string the ROT13 version of the given string.
*/
#[Pure]
function str_rot13($string) { }
function str_rot13(string $string) { }
/**
* Retrieve list of registered filters
@ -1109,7 +1112,7 @@ function stream_isatty($stream) {}
* stream_filter_register will return false if the
* filtername is already defined.
*/
function stream_filter_register($filter_name, $class) { }
function stream_filter_register(string $filter_name, string $class) { }
/**
* Return a bucket object from the brigade for operating on
@ -1126,7 +1129,7 @@ function stream_bucket_make_writeable($brigade) { }
* @param object $bucket
* @return void
*/
function stream_bucket_prepend($brigade, $bucket) { }
function stream_bucket_prepend($brigade, object $bucket) { }
/**
* Append bucket to brigade
@ -1135,7 +1138,7 @@ function stream_bucket_prepend($brigade, $bucket) { }
* @param object $bucket
* @return void
*/
function stream_bucket_append($brigade, $bucket) { }
function stream_bucket_append($brigade, object $bucket) { }
/**
* Create a new bucket for use on the current stream
@ -1144,7 +1147,7 @@ function stream_bucket_append($brigade, $bucket) { }
* @param string $buffer
* @return object
*/
function stream_bucket_new($stream, $buffer) { }
function stream_bucket_new($stream, string $buffer) { }
/**
* Add URL rewriter values
@ -1157,7 +1160,7 @@ function stream_bucket_new($stream, $buffer) { }
* </p>
* @return bool true on success or false on failure.
*/
function output_add_rewrite_var($name, $value) { }
function output_add_rewrite_var(string $name, string $value) { }
/**
* Reset URL rewriter values
@ -1227,7 +1230,7 @@ function realpath_cache_size() { }
* @return array returns the mangled object properties
* @since 7.4
*/
function get_mangled_object_vars($object){}
function get_mangled_object_vars(object $object){}
/**
* Get the type or object name of a variable

View File

@ -14,7 +14,7 @@
* </p>
* @return resource|SysvMessageQueue a resource handle that can be used to access the System V message queue.
*/
function msg_get_queue ($key, $permissions = 0666) {}
function msg_get_queue (int $key, int $permissions = 0666) {}
/**
* Send a message to a message queue
@ -249,7 +249,7 @@ function msg_set_queue ($queue, array $data) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function msg_queue_exists ($key) {}
function msg_queue_exists (int $key) {}
define ('MSG_IPC_NOWAIT', 1);
define ('MSG_EAGAIN', 11);

View File

@ -15,14 +15,14 @@
* set only if the process finds it is the only process currently
* attached to the semaphore.
* </p>
* @param int $auto_release [optional] <p>
* @param bool $auto_release [optional] <p>
* Specifies if the semaphore should be automatically released on request
* shutdown.
* </p>
* @return resource|false|SysvSemaphore a positive semaphore identifier on success, or <b>FALSE</b> on
* error.
*/
function sem_get ($key, $max_acquire = 1, $permissions = 0666, $auto_release = 1) {}
function sem_get (int $key, int $max_acquire = 1, int $permissions = 0666, bool $auto_release) {}
/**
* Acquire a semaphore

View File

@ -18,7 +18,7 @@
* </p>
* @return resource|SysvSharedMemory a shared memory segment identifier.
*/
function shm_attach ($key, $size = null, $permissions = 0666) {}
function shm_attach (int $key, int $size, int $permissions = 0666) {}
/**
* Removes shared memory from Unix systems

View File

@ -3,9 +3,15 @@ declare(strict_types=1);
namespace StubTests\Model;
use PhpParser\Node\Expr;
use PhpParser\Node\Identifier;
use PhpParser\Node\Name;
use PhpParser\Node\NullableType;
use PhpParser\Node\Param;
use PhpParser\Node\UnionType;
use ReflectionNamedType;
use ReflectionParameter;
use ReflectionUnionType;
use stdClass;
class PHPParameter extends BasePHPElement
@ -25,6 +31,12 @@ class PHPParameter extends BasePHPElement
if ($parameterType instanceof ReflectionNamedType) {
$this->type = $parameterType->getName();
}
if ($parameterType instanceof ReflectionUnionType) {
foreach ($parameterType->getTypes() as $type) {
$this->type .= $type->getName() . '|';
}
$this->type = substr($this->type, 0, -1);
}
$this->is_vararg = $reflectionObject->isVariadic();
$this->is_passed_by_ref = $reflectionObject->isPassedByReference();
return $this;
@ -36,16 +48,22 @@ class PHPParameter extends BasePHPElement
*/
public function readObjectFromStubNode($node): static
{
// #[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")]
$this->name = $node->var->name;
if ($node->type !== null) {
if (empty($node->type->name)) {
if (!empty($node->type->parts)) {
$this->type = $node->type->parts[0];
$type = $node->type;
if ($type !== null) {
if ($type instanceof UnionType) {
foreach ($type->types as $type) {
$this->type .= $this->getTypeNameFromNode($type) . '|';
}
$this->type = substr($this->type, 0, -1);
} else {
$this->type = $node->type->name;
$this->type = $this->getTypeNameFromNode($type);
}
}
if($node->default instanceof Expr\ConstFetch && $node->default->name->parts[0] === "null"){
$this->type .= "|null";
}
$this->is_vararg = $node->variadic;
$this->is_passed_by_ref = $node->byRef;
return $this;
@ -69,4 +87,18 @@ class PHPParameter extends BasePHPElement
}
}
}
protected function getTypeNameFromNode(Name|Identifier|NullableType|string $type): string
{
if($type instanceof NullableType){
$type = $type->type;
}
if (empty($type->name)) {
if (!empty($type->parts)) {
return $type->parts[0];
}
} else {
return $type->name;
}
}
}

View File

@ -116,6 +116,8 @@ 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 ");
}
}
}

View File

@ -28,7 +28,7 @@ use JetBrains\PhpStorm\Pure;
* content of the original token in element 1 and the line number in element 2.
*/
#[Pure]
function token_get_all ($code, $flags = 0) {}
function token_get_all (string $code, int $flags = 0) {}
/**
* Get the symbolic name of a given PHP token
@ -39,7 +39,7 @@ function token_get_all ($code, $flags = 0) {}
* @return string The symbolic name of the given <i>token</i>.
*/
#[Pure]
function token_name ($id) {}
function token_name (int $id) {}
define('TOKEN_PARSE', 1);
define('T_REQUIRE_ONCE', 263);

View File

@ -22,7 +22,7 @@ use JetBrains\PhpStorm\Pure;
* @return resource|false|XmlParser a resource handle for the new XML parser.
*/
#[Pure]
function xml_parser_create ($encoding = null) {}
function xml_parser_create (string $encoding) {}
/**
* Create an XML parser with namespace support
@ -46,7 +46,7 @@ function xml_parser_create ($encoding = null) {}
* @return resource|false|XmlParser a resource handle for the new XML parser.
*/
#[Pure]
function xml_parser_create_ns ($encoding = null, $separator = ':') {}
function xml_parser_create_ns (string $encoding, string $separator = ':') {}
/**
* Use XML Parser within an object
@ -59,7 +59,7 @@ function xml_parser_create_ns ($encoding = null, $separator = ':') {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function xml_set_object ($parser, &$object) {}
function xml_set_object ($parser, object &$object) {}
/**
* Set up start and end element handlers
@ -337,7 +337,7 @@ function xml_set_end_namespace_decl_handler ($parser, callable $handler) {}
* Entity errors are reported at the end of the data thus only if
* <i>is_final</i> is set and <b>TRUE</b>.
*/
function xml_parse ($parser, $data, $is_final = false) {}
function xml_parse ($parser, string $data, $is_final = false) {}
/**
* Parse XML data into an array structure
@ -358,7 +358,8 @@ function xml_parse ($parser, $data, $is_final = false) {}
* success. This is not the same as <b>FALSE</b> and <b>TRUE</b>, be careful with
* operators such as ===.
*/
function xml_parse_into_struct ($parser, $data, array &$values, array &$index = null) {}
function xml_parse_into_struct ($parser, string $data, array &$values, array &$index)
{}
/**
* Get XML parser error code
@ -384,7 +385,7 @@ function xml_get_error_code ($parser) {}
* <i>code</i>, or <b>FALSE</b> if no description was found.
*/
#[Pure]
function xml_error_string ($error_code) {}
function xml_error_string (int $error_code) {}
/**
* Get current line number for an XML parser
@ -497,7 +498,7 @@ function xml_parser_free ($parser) {}
* refer to a valid parser, or if the option could not be set. Else the
* option is set and <b>TRUE</b> is returned.
*/
function xml_parser_set_option ($parser, $option, $value) {}
function xml_parser_set_option ($parser, int $option, mixed $value) {}
/**
* Get options from an XML parser
@ -512,7 +513,7 @@ function xml_parser_set_option ($parser, $option, $value) {}
* Else the option's value is returned.
*/
#[Pure]
function xml_parser_get_option ($parser, $option) {}
function xml_parser_get_option ($parser, int $option) {}
define ('XML_ERROR_NONE', 0);
define ('XML_ERROR_NO_MEMORY', 1);

View File

@ -523,7 +523,7 @@ class XMLWriter {
* Procedural style: Returns a new xmlwriter resource for later use with the
* xmlwriter functions on success, <b>FALSE</b> on error.
*/
function xmlwriter_open_uri ($uri) {}
function xmlwriter_open_uri (string $uri) {}
/**
* (PHP 5 &gt;= 5.1.2, PECL xmlwriter &gt;= 0.1.0)<br/>

View File

@ -17,7 +17,7 @@ use JetBrains\PhpStorm\Pure;
* </p>
* @return int|false the number of (uncompressed) bytes read from the file, or FALSE on error
*/
function readgzfile ($filename, $use_include_path = 0) {}
function readgzfile (string $filename, int $use_include_path = 0) {}
/**
* Rewind the position of a gz-file pointer
@ -76,7 +76,7 @@ function gzgetc ($stream) {}
* </p>
* @return string|false The uncompressed string, or <b>FALSE</b> on error.
*/
function gzgets ($stream, $length) {}
function gzgets ($stream, int $length) {}
/**
* Get line from gz-file pointer and strip HTML tags
@ -96,7 +96,8 @@ function gzgets ($stream, $length) {}
* @removed 8.0
*/
#[Deprecated(since: "7.3")]
function gzgetss ($zp, $length, $allowable_tags = null) {}
function gzgetss ($zp, int $length, $allowable_tags)
{}
/**
* Binary-safe gz-file read
@ -110,7 +111,7 @@ function gzgetss ($zp, $length, $allowable_tags = null) {}
* </p>
* @return string The data that have been read.
*/
function gzread ($stream, $length) {}
function gzread ($stream, int $length) {}
/**
* Open gz-file
@ -139,7 +140,7 @@ function gzread ($stream, $length) {}
* <p>
* If the open fails, the function returns <b>FALSE</b>.
*/
function gzopen ($filename, $mode, $use_include_path = 0) {}
function gzopen (string $filename, string $mode, int $use_include_path = 0) {}
/**
* Output all remaining data on a gz-file pointer
@ -175,7 +176,7 @@ function gzpassthru ($stream) {}
* @return int Upon success, returns 0; otherwise, returns -1. Note that seeking
* past EOF is not considered an error.
*/
function gzseek ($stream, $offset, $whence = SEEK_SET) {}
function gzseek ($stream, int $offset, int $whence = SEEK_SET) {}
/**
* Tell gz-file pointer read/write position
@ -213,7 +214,8 @@ function gztell ($stream) {}
* @return int the number of (uncompressed) bytes written to the given gz-file
* stream.
*/
function gzwrite ($stream, $data, $length = null) {}
function gzwrite ($stream, string $data, int $length)
{}
/**
* Alias of <b>gzwrite</b>
@ -222,7 +224,7 @@ function gzwrite ($stream, $data, $length = null) {}
* @param string $data
* @param int $length [optional]
*/
function gzputs ($stream, $data, $length) {}
function gzputs ($stream, string $data, int $length) {}
/**
* Read entire gz-file into an array
@ -236,7 +238,7 @@ function gzputs ($stream, $data, $length) {}
* </p>
* @return array An array containing the file, one line per cell.
*/
function gzfile ($filename, $use_include_path = 0) {}
function gzfile (string $filename, int $use_include_path = 0) {}
/**
* Compress a string
@ -257,7 +259,7 @@ function gzfile ($filename, $use_include_path = 0) {}
* @return string|false The compressed string or <b>FALSE</b> if an error occurred.
*/
#[Pure]
function gzcompress ($data, $level = -1, $encoding = ZLIB_ENCODING_DEFLATE) {}
function gzcompress (string $data, int $level = -1, int $encoding = ZLIB_ENCODING_DEFLATE) {}
/**
* Uncompress a compressed string
@ -276,7 +278,7 @@ function gzcompress ($data, $level = -1, $encoding = ZLIB_ENCODING_DEFLATE) {}
* or more than the optional parameter <i>length</i>.
*/
#[Pure]
function gzuncompress ($data, $max_length = 0) {}
function gzuncompress (string $data, int $max_length = 0) {}
/**
* Deflate a string
@ -295,7 +297,7 @@ function gzuncompress ($data, $max_length = 0) {}
* @return string|false The deflated string or <b>FALSE</b> if an error occurred.
*/
#[Pure]
function gzdeflate ($data, $level = -1, $encoding = ZLIB_ENCODING_RAW) {}
function gzdeflate (string $data, int $level = -1, int $encoding = ZLIB_ENCODING_RAW) {}
/**
* Inflate a deflated string
@ -314,7 +316,7 @@ function gzdeflate ($data, $level = -1, $encoding = ZLIB_ENCODING_RAW) {}
* or more than the optional parameter <i>length</i>.
*/
#[Pure]
function gzinflate ($data, $max_length = 0) {}
function gzinflate (string $data, int $max_length = 0) {}
/**
* Create a gzip compressed string
@ -344,7 +346,7 @@ function gzinflate ($data, $max_length = 0) {}
* @return string|false The encoded string, or <b>FALSE</b> if an error occurred.
*/
#[Pure]
function gzencode ($data, $level = -1, $encoding = FORCE_GZIP) {}
function gzencode (string $data, int $level = -1, int $encoding = FORCE_GZIP) {}
/**
* Decodes a gzip compressed string
@ -359,7 +361,8 @@ function gzencode ($data, $level = -1, $encoding = FORCE_GZIP) {}
* @since 5.4
*/
#[Pure]
function gzdecode ($data, $max_length = null) {}
function gzdecode (string $data, int $max_length)
{}
/**
* Compress data with the specified encoding
@ -374,7 +377,7 @@ function gzdecode ($data, $max_length = null) {}
* @since 5.4
*/
#[Pure]
function zlib_encode ($data, $encoding, $level) {}
function zlib_encode (string $data, int $encoding, int $level) {}
/**
* Uncompress any raw/gzip/zlib encoded data
@ -387,7 +390,8 @@ function zlib_encode ($data, $encoding, $level) {}
* @since 5.4
*/
#[Pure]
function zlib_decode ($data, $max_length = null) {}
function zlib_decode (string $data, int $max_length)
{}
/**
* Returns the coding type used for output compression
@ -405,7 +409,7 @@ function zlib_get_coding_type () {}
* @param int $flags
* @return string
*/
function ob_gzhandler ($data, $flags) {}
function ob_gzhandler (string $data, int $flags) {}
/**
* Initialize an incremental deflate context
@ -429,7 +433,7 @@ function ob_gzhandler ($data, $flags) {}
* @since 7.0
*/
#[Pure]
function deflate_init ($encoding, $options = array()) {}
function deflate_init (int $encoding, array $options = array()) {}
/**
* Incrementally deflate data
@ -452,7 +456,7 @@ function deflate_init ($encoding, $options = array()) {}
* </p>
* @since 7.0
*/
function deflate_add ($context, $data, $flush_mode = ZLIB_SYNC_FLUSH) {}
function deflate_add ($context, string $data, $flush_mode = ZLIB_SYNC_FLUSH) {}
/**
* Initialize an incremental inflate context
@ -476,7 +480,7 @@ function deflate_add ($context, $data, $flush_mode = ZLIB_SYNC_FLUSH) {}
* @since 7.0
*/
#[Pure]
function inflate_init ($encoding, $options = array()) {}
function inflate_init (int $encoding, array $options = array()) {}
/**
* Incrementally inflate encoded data
@ -499,7 +503,7 @@ function inflate_init ($encoding, $options = array()) {}
* </p>
* @since 7.0
*/
function inflate_add ($context, $data, $flush_mode = ZLIB_SYNC_FLUSH) {}
function inflate_add ($context, string $data, $flush_mode = ZLIB_SYNC_FLUSH) {}
/**
* Get number of bytes read so far