* The argument offset. Function arguments are counted starting from * zero. *
* @return mixed|false the specified argument, or false on error. */ #[Pure] function func_get_arg(int $position): mixed {} /** * Returns an array comprising a function's argument list * @link https://php.net/manual/en/function.func-get-args.php * @return array an array in which each element is a copy of the corresponding * member of the current user-defined function's argument list. */ #[Pure] function func_get_args(): array {} /** * Get string length * @link https://php.net/manual/en/function.strlen.php * @param string $string* The string being measured for length. *
* @return int<0,max> The length of the string on success, * and 0 if the string is empty. */ #[Pure] function strlen(string $string): int {} /** * Binary safe string comparison * @link https://php.net/manual/en/function.strcmp.php * @param string $string1* The first string. *
* @param string $string2* The second string. *
* @return int less 0 if str1 is less than * str2; > 0 if str1 * is greater than str2, and 0 if they are * equal. */ #[Pure] function strcmp(string $string1, string $string2): int {} /** * Binary safe string comparison of the first n characters * @link https://php.net/manual/en/function.strncmp.php * @param string $string1* The first string. *
* @param string $string2* The second string. *
* @param int $length* Number of characters to use in the comparison. *
* @return int less 0 if str1 is less than * str2; > 0 if str1 * is greater than str2, and 0 if they are * equal. */ #[Pure] function strncmp(string $string1, string $string2, int $length): int {} /** * Binary safe case-insensitive string comparison * @link https://php.net/manual/en/function.strcasecmp.php * @param string $string1* The first string *
* @param string $string2* The second string *
* @return int less than 0 if str1 is less than * str2; > 0 if str1 * is greater than str2, and 0 if they are * equal. */ #[Pure] function strcasecmp(string $string1, string $string2): int {} /** * Binary safe case-insensitive string comparison of the first n characters * @link https://php.net/manual/en/function.strncasecmp.php * @param string $string1* The first string. *
* @param string $string2* The second string. *
* @param int $length* The length of strings to be used in the comparison. *
* @return int less than 0 if str1 is less than * str2; > 0 if str1 is * greater than str2, and 0 if they are equal. */ #[Pure] function strncasecmp(string $string1, string $string2, int $length): int {} /** * The function returns {@see true} if the passed $haystack starts from the * $needle string or {@see false} otherwise. * * @param string $haystack * @param string $needle * @return bool * @since 8.0 */ #[Pure] function str_starts_with(string $haystack, string $needle): bool {} /** * The function returns {@see true} if the passed $haystack ends with the * $needle string or {@see false} otherwise. * * @param string $haystack * @param string $needle * @return bool * @since 8.0 */ #[Pure] function str_ends_with(string $haystack, string $needle): bool {} /** * Checks if $needle is found in $haystack and returns a boolean value * (true/false) whether or not the $needle was found. * * @param string $haystack * @param string $needle * @return bool * @since 8.0 */ #[Pure] function str_contains(string $haystack, string $needle): bool {} /** * @since 8.3 */ function str_decrement(string $string): string {} /** * @since 8.3 */ function str_increment(string $string): string {} /** * Return the current key and value pair from an array and advance the array cursor * @link https://php.net/manual/en/function.each.php * @param array|ArrayObject &$array* The input array. *
* @return array the current key and value pair from the array * array. This pair is returned in a four-element * array, with the keys 0, 1, * key, and value. Elements * 0 and key contain the key name of * the array element, and 1 and value * contain the data. * ** If the internal pointer for the array points past the end of the * array contents, each returns * false. * @removed 8.0 */ #[Deprecated(reason: "Use a foreach loop instead", since: "7.2")] function each(&$array): array {} /** * Sets which PHP errors are reported * @link https://php.net/manual/en/function.error-reporting.php * @param int|null $error_level [optional]
* The new error_reporting * level. It takes on either a bitmask, or named constants. Using named * constants is strongly encouraged to ensure compatibility for future * versions. As error levels are added, the range of integers increases, * so older integer-based error levels will not always behave as expected. *
** The available error level constants and the actual * meanings of these error levels are described in the * predefined constants. *
| value | *constant | *
| 1 | ** E_ERROR * | *
| 2 | ** E_WARNING * | *
| 4 | ** E_PARSE * | *
| 8 | ** E_NOTICE * | *
| 16 | ** E_CORE_ERROR * | *
| 32 | ** E_CORE_WARNING * | *
| 64 | ** E_COMPILE_ERROR * | *
| 128 | ** E_COMPILE_WARNING * | *
| 256 | ** E_USER_ERROR * | *
| 512 | ** E_USER_WARNING * | *
| 1024 | ** E_USER_NOTICE * | *
| 32767 | ** E_ALL * | *
| 2048 | ** E_STRICT * | *
| 4096 | ** E_RECOVERABLE_ERROR * | *
| 8192 | ** E_DEPRECATED * | *
| 16384 | ** E_USER_DEPRECATED * | *
* The name of the constant. *
* @param null|array|bool|int|float|string $value* The value of the constant. * In PHP 5, value must be a scalar value (integer, float, string, boolean, or null). * In PHP 7, array values are also accepted. * It is possible to define resource constants, * however it is not recommended and may cause unpredictable behavior. *
* @param bool $case_insensitive [optional]* If set to true, the constant will be defined case-insensitive. * The default behavior is case-sensitive; i.e. * CONSTANT and Constant represent * different values. * Defining case-insensitive constants is deprecated as of PHP 7.3.0. *
** Case-insensitive constants are stored as lower-case. *
* @return bool true on success or false on failure. */ function define( string $constant_name, #[LanguageLevelTypeAware(['8.1' => 'mixed'], default: 'null|array|bool|int|float|string')] $value, #[Deprecated(since: "7.3")] bool $case_insensitive = false ): bool {} /** * Checks whether a given named constant exists * @link https://php.net/manual/en/function.defined.php * @param string $constant_name* The constant name. *
* @return bool true if the named constant given by name * has been defined, false otherwise. */ #[Pure(true)] function defined(string $constant_name): bool {} /** * Returns the name of the class of an object * @link https://php.net/manual/en/function.get-class.php * @param object $object [optional]* The tested object. This parameter may be omitted when inside a class. *
* @return stringThe name of the class of which object is an * instance. * If object is omitted when inside a class, the * name of that class is returned.
*/ #[Pure] function get_class(object $object): string {} /** * the "Late Static Binding" class name * @link https://php.net/manual/en/function.get-called-class.php * @return string */ #[Pure] function get_called_class(): string {} /** * Retrieves the parent class name for object or class * @link https://php.net/manual/en/function.get-parent-class.php * @param object|string $object_or_class [optional]* The tested object or class name *
* @return string|falseThe name of the parent class of the class of which * object is an instance or the name. *
** If the object does not have a parent false will be returned. *
** If called without parameter outside object, this function returns false.
*/ #[Pure] function get_parent_class(object|string $object_or_class): string|false {} /** * Checks if the class method exists * @link https://php.net/manual/en/function.method-exists.php * @param object|string $object_or_class* An object instance or a class name *
* @param string $method* The method name *
* @return bool true if the method given by method_name * has been defined for the given object, false * otherwise. */ #[Pure] function method_exists($object_or_class, string $method): bool {} /** * Checks if the object or class has a property * @link https://php.net/manual/en/function.property-exists.php * @param object|string $object_or_class* The class name or an object of the class to test for *
* @param string $property* The name of the property *
* @return bool true if the property exists, false if it doesn't exist or * null in case of an error. */ #[Pure] function property_exists($object_or_class, string $property): bool {} /** * Checks if the trait exists * @param string $trait Name of the trait to check * @param bool $autoload [optional] Whether to autoload if not already loaded. * @return bool Returns TRUE if trait exists, FALSE if not, NULL in case of an error. * @link https://secure.php.net/manual/en/function.trait-exists.php * @since 5.4 */ function trait_exists(string $trait, bool $autoload = true): bool {} /** * Checks if the class has been defined * @link https://php.net/manual/en/function.class-exists.php * @param string $class* The class name. The name is matched in a case-insensitive manner. *
* @param bool $autoload [optional]* Whether or not to call autoload by default. *
* @return bool true if class_name is a defined class, * false otherwise. */ function class_exists(string $class, bool $autoload = true): bool {} /** * Checks if the interface has been defined * @link https://php.net/manual/en/function.interface-exists.php * @param string $interface* The interface name *
* @param bool $autoload [optional]* Whether to call autoload or not by default. *
* @return bool true if the interface given by * interface_name has been defined, false otherwise. * @since 5.0.2 */ function interface_exists(string $interface, bool $autoload = true): bool {} /** * Return true if the given function has been defined * @link https://php.net/manual/en/function.function-exists.php * @param string $function* The function name, as a string. *
* @return bool true if function_name exists and is a * function, false otherwise. * ** This function will return false for constructs, such as * include_once and echo. */ #[Pure(true)] function function_exists(string $function): bool {} /** * Checks if the enum has been defined * @link https://php.net/manual/en/function.enum-exists.php * @param string $enum
* The enum name. The name is matched in a case-insensitive manner. *
* @param bool $autoload [optional]* Whether or not to call autoload by default. *
* @return bool true if enum is a defined enum, * false otherwise. * @since 8.1 */ function enum_exists(string $enum, bool $autoload = true): bool {} /** * Creates an alias for a class * @link https://php.net/manual/en/function.class-alias.php * @param string $class The original class. * @param string $alias The alias name for the class. * @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(string $class, string $alias, bool $autoload = true): bool {} /** * Returns an array with the names of included or required files * @link https://php.net/manual/en/function.get-included-files.php * @return string[] an array of the names of all files. ** The script originally called is considered an "included file," so it will * be listed together with the files referenced by * include and family. *
** Files that are included or required multiple times only show up once in * the returned array. *
*/ #[Pure(true)] function get_included_files(): array {} /** * Alias of get_included_files * @link https://php.net/manual/en/function.get-required-files.php * @return string[] */ #[Pure(true)] function get_required_files(): array {} /** * checks if the object has this class as one of its parents or implements it * @link https://php.net/manual/en/function.is-subclass-of.php * @param object|string $object_or_class* A class name or an object instance *
* @param string $class* The class name *
* @param bool $allow_string [optional]* If this parameter set to false, string class name as object is not allowed. * This also prevents from calling autoloader if the class doesn't exist. *
* @return bool This function returns true if the object object, * belongs to a class which is a subclass of * class_name, false otherwise. */ #[Pure] function is_subclass_of(mixed $object_or_class, string $class, bool $allow_string = true): bool {} /** * Checks if the object is of this class or has this class as one of its parents * @link https://php.net/manual/en/function.is-a.php * @param object|string $object_or_class* The tested object *
* @param string $class* The class name *
* @param bool $allow_string [optional]* If this parameter set to FALSE, string class name as object * is not allowed. This also prevents from calling autoloader if the class doesn't exist. *
* @return bool TRUE if the object is of this class or has this class as one of * its parents, FALSE otherwise. */ #[Pure] function is_a(mixed $object_or_class, string $class, bool $allow_string = false): bool {} /** * Get the default properties of the class * @link https://php.net/manual/en/function.get-class-vars.php * @param string $class* The class name *
* @return array an associative array of declared properties visible from the * current scope, with their default value. * The resulting array elements are in the form of * varname => value. */ #[Pure] function get_class_vars(string $class): array {} /** * Gets the properties of the given object * @link https://php.net/manual/en/function.get-object-vars.php * @param object $object* An object instance. *
* @return array an associative array of defined object accessible non-static properties * for the specified object in scope. If a property have * not been assigned a value, it will be returned with a null value. */ #[Pure] function get_object_vars(object $object): array {} /** * Gets the class methods' names * @link https://php.net/manual/en/function.get-class-methods.php * @param object|string $object_or_class* The class name or an object instance *
* @return string[] an array of method names defined for the class specified by * class_name. In case of an error, it returns null. */ #[Pure] function get_class_methods(object|string $object_or_class): array {} /** * Generates a user-level error/warning/notice message * @link https://php.net/manual/en/function.trigger-error.php * @param string $message* The designated error message for this error. It's limited to 1024 * characters in length. Any additional characters beyond 1024 will be * truncated. *
* @param int $error_level [optional]* The designated error type for this error. It only works with the E_USER * family of constants, and will default to E_USER_NOTICE. *
* @return bool This function returns false if wrong error_type is * specified, true otherwise. */ function trigger_error(string $message, int $error_level = E_USER_NOTICE): bool {} /** * Alias of trigger_error * @link https://php.net/manual/en/function.user-error.php * @param string $message * @param int $error_level [optional] * @return bool This function returns false if wrong error_type is * specified, true otherwise. */ function user_error(string $message, int $error_level = E_USER_NOTICE): bool {} /** * Sets a user-defined error handler function * @link https://php.net/manual/en/function.set-error-handler.php * @param callable|null $callback* 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 * line number in which the error occurred, and the context in which the * error occurred (an array that points to the active symbol table at the * point the error occurred). The function can be shown as: *
** handler * interrno * stringerrstr * stringerrfile * interrline * arrayerrcontext * errno * The first parameter, errno, contains the * level of the error raised, as an integer.
* @param int $error_levels [optional]* Can be used to mask the triggering of the * error_handler function just like the error_reporting ini setting * controls which errors are shown. Without this mask set the * error_handler will be called for every error * regardless to the setting of the error_reporting setting. *
* @return callable|null a string containing the previously defined error handler (if any). If * the built-in error handler is used null is returned. null is also returned * in case of an error such as an invalid callback. If the previous error handler * was a class method, this function will return an indexed array with the class * and the method name. */ function set_error_handler(?callable $callback, int $error_levels = E_ALL|E_STRICT) {} /** * Restores the previous error handler function * @link https://php.net/manual/en/function.restore-error-handler.php * @return bool This function always returns true. */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] function restore_error_handler(): bool {} /** * Sets a user-defined exception handler function * @link https://php.net/manual/en/function.set-exception-handler.php * @param callable|null $callback* Name of the function to be called when an uncaught exception occurs. * This function must be defined before calling * set_exception_handler. This handler function * needs to accept one parameter, which will be the exception object that * was thrown. * NULL may be passed instead, to reset this handler to its default state. *
* @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(?callable $callback) {} /** * Restores the previously defined exception handler function * @link https://php.net/manual/en/function.restore-exception-handler.php * @return bool This function always returns true. */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] function restore_exception_handler(): bool {} /** * Returns an array with the name of the defined classes * @link https://php.net/manual/en/function.get-declared-classes.php * @return string[] an array of the names of the declared classes in the current script. ** Note that depending on what extensions you have compiled or * loaded into PHP, additional classes could be present. This means that * you will not be able to define your own classes using these * names. There is a list of predefined classes in the Predefined Classes section of * the appendices. *
*/ #[Pure(true)] function get_declared_classes(): array {} /** * Returns an array of all declared interfaces * @link https://php.net/manual/en/function.get-declared-interfaces.php * @return string[] an array of the names of the declared interfaces in the current * script. */ #[Pure(true)] function get_declared_interfaces(): array {} /** * Returns an array of all declared traits * @return array with names of all declared traits in values. Returns NULL in case of a failure. * @link https://secure.php.net/manual/en/function.get-declared-traits.php * @see class_uses() * @since 5.4 */ #[Pure(true)] function get_declared_traits(): array {} /** * Returns an array of all defined functions * @link https://php.net/manual/en/function.get-defined-functions.php * @param bool $exclude_disabled [optional] Whether disabled functions should be excluded from the return value. * @return array an multidimensional array containing a list of all defined * functions, both built-in (internal) and user-defined. The internal * functions will be accessible via $arr["internal"], and * the user defined ones using $arr["user"] (see example * below). */ #[Pure(true)] function get_defined_functions(#[PhpStormStubsElementAvailable(from: '7.1')] bool $exclude_disabled = true): array {} /** * Returns an array of all defined variables * @link https://php.net/manual/en/function.get-defined-vars.php * @return array A multidimensional array with all the variables. */ #[Pure(true)] function get_defined_vars(): array {} /** * Create an anonymous (lambda-style) function * @link https://php.net/manual/en/function.create-function.php * @param string $args* The function arguments. *
* @param string $code* The function code. *
* @return string|false a unique function name as a string, or false on error. * @removed 8.0 */ #[Deprecated(reason: "Use anonymous functions instead", since: "7.2")] function create_function(string $args, string $code): false|string {} /** * Returns the resource type * @link https://php.net/manual/en/function.get-resource-type.php * @param resource $resource* The evaluated resource handle. *
* @return string If the given handle is a resource, this function * will return a string representing its type. If the type is not identified * by this function, the return value will be the string * Unknown. */ function get_resource_type($resource): string {} /** * Returns an array with the names of all modules compiled and loaded * @link https://php.net/manual/en/function.get-loaded-extensions.php * @param bool $zend_extensions [optional]* Only return Zend extensions, if not then regular extensions, like * mysqli are listed. Defaults to false (return regular extensions). *
* @return string[] an indexed array of all the modules names. */ #[Pure] function get_loaded_extensions(bool $zend_extensions = false): array {} /** * Find out whether an extension is loaded * @link https://php.net/manual/en/function.extension-loaded.php * @param string $extension* The extension name. *
** You can see the names of various extensions by using * phpinfo or if you're using the * CGI or CLI version of * PHP you can use the -m switch to * list all available extensions: *
* $ php -m * [PHP Modules] * xml * tokenizer * standard * sockets * session * posix * pcre * overload * mysql * mbstring * ctype * [Zend Modules] ** * @return bool true if the extension identified by name * is loaded, false otherwise. */ #[Pure] function extension_loaded(string $extension): bool {} /** * Returns an array with the names of the functions of a module * @link https://php.net/manual/en/function.get-extension-funcs.php * @param string $extension
* The module name. *
** This parameter must be in lowercase. *
* @return string[]|false an array with all the functions, or false if * module_name is not a valid extension. */ #[Pure] function get_extension_funcs(string $extension): array|false {} /** * Returns an associative array with the names of all the constants and their values * @link https://php.net/manual/en/function.get-defined-constants.php * @param bool $categorize [optional]
* Causing this function to return a multi-dimensional
* array with categories in the keys of the first dimension and constants
* and their values in the second dimension.
*
* define("MY_CONSTANT", 1);
* print_r(get_defined_constants(true));
*
* The above example will output something similar to:
*
* Array * ( * [Core] => Array * ( * [E_ERROR] => 1 * [E_WARNING] => 2 * [E_PARSE] => 4 * [E_NOTICE] => 8 * [E_CORE_ERROR] => 16 * [E_CORE_WARNING] => 32 * [E_COMPILE_ERROR] => 64 * [E_COMPILE_WARNING] => 128 * [E_USER_ERROR] => 256 * [E_USER_WARNING] => 512 * [E_USER_NOTICE] => 1024 * [E_STRICT] => 2048 * [E_RECOVERABLE_ERROR] => 4096 * [E_DEPRECATED] => 8192 * [E_USER_DEPRECATED] => 16384 * [E_ALL] => 32767 * [TRUE] => 1 * ) * [pcre] => Array * ( * [PREG_PATTERN_ORDER] => 1 * [PREG_SET_ORDER] => 2 * [PREG_OFFSET_CAPTURE] => 256 * [PREG_SPLIT_NO_EMPTY] => 1 * [PREG_SPLIT_DELIM_CAPTURE] => 2 * [PREG_SPLIT_OFFSET_CAPTURE] => 4 * [PREG_GREP_INVERT] => 1 * ) * [user] => Array * ( * [MY_CONSTANT] => 1 * ) * ) ** * @return array */ #[Pure(true)] function get_defined_constants(bool $categorize = false): array {} /** * Generates a backtrace * @link https://php.net/manual/en/function.debug-backtrace.php * @param int $options [optional]
* As of 5.3.6, this parameter is a bitmask for the following options:
* debug_backtrace options *| DEBUG_BACKTRACE_PROVIDE_OBJECT | ** Whether or not to populate the "object" index. * | *
| DEBUG_BACKTRACE_IGNORE_ARGS | ** Whether or not to omit the "args" index, and thus all the function/method arguments, * to save memory. * | *
* Before 5.3.6, the only values recognized are true or false, which are the same as * setting or not setting the DEBUG_BACKTRACE_PROVIDE_OBJECT option respectively. *
* @param int $limit [optional]* As of 5.4.0, this parameter can be used to limit the number of stack frames returned. * By default (limit=0) it returns all stack frames. *
* @return arrayan array of associative arrays. The possible returned elements * are as follows: *
** Possible returned elements from debug_backtrace *
*| Name | *Type | *Description | *
| function | *string | ** The current function name. See also * __FUNCTION__. * | *
| line | *integer | ** The current line number. See also * __LINE__. * | *
| file | *string | ** The current file name. See also * __FILE__. * | *
| class | *string | ** The current class name. See also * __CLASS__ * | *
| object | *object | ** The current object. * | *
| type | *string | ** The current call type. If a method call, "->" is returned. If a static * method call, "::" is returned. If a function call, nothing is returned. * | *
| args | *array | ** If inside a function, this lists the functions arguments. If * inside an included file, this lists the included file name(s). * | *
* As of 5.3.6, this parameter is a bitmask for the following options: * debug_print_backtrace options *
| DEBUG_BACKTRACE_IGNORE_ARGS | ** Whether or not to omit the "args" index, and thus all the function/method arguments, * to save memory. * | *
* As of 5.4.0, this parameter can be used to limit the number of stack frames printed. * By default (limit = 0) it prints all stack frames. *
* @return void */ function debug_print_backtrace( int $options = 0, #[PhpStormStubsElementAvailable(from: '7.0')] int $limit = 0 ): void {} /** * Forces collection of any existing garbage cycles * @link https://php.net/manual/en/function.gc-collect-cycles.php * @return int number of collected cycles. */ function gc_collect_cycles(): int {} /** * Returns status of the circular reference collector * @link https://php.net/manual/en/function.gc-enabled.php * @return bool true if the garbage collector is enabled, false otherwise. */ #[Pure(true)] function gc_enabled(): bool {} /** * Activates the circular reference collector * @link https://php.net/manual/en/function.gc-enable.php * @return void */ function gc_enable(): void {} /** * Deactivates the circular reference collector * @link https://php.net/manual/en/function.gc-disable.php * @return void */ function gc_disable(): void {} /** * Gets information about the garbage collector * @link https://php.net/manual/en/function.gc-status.php * @return int[] associative array with the following elements: ** * If defined, this will cause get_resources() to only return resources of the given type. A list of resource types is available. * * If the string Unknown is provided as the type, then only resources that are of an unknown type will be returned. * * If omitted, all resources will be returned. *
* @return resource[] Returns an array of currently active resources, indexed by resource number. * @since 7.0 */ #[Pure(true)] function get_resources(?string $type): array {}