'string'], default: '')] public $filtername; #[LanguageLevelTypeAware(['8.1' => 'mixed'], default: '')] public $params; public $stream; /** * @link https://php.net/manual/en/php-user-filter.filter.php * @param resource $in
is a resource pointing to a bucket brigadebucket objects containing data to be filtered.
* @param resource $outis a resource pointing to a second bucket brigade into which your modified buckets should be placed.
* @param int &$consumedwhich must always be declared by reference, should be incremented by the length of the data which your filter reads in and alters. In most cases this means you will increment consumed by $bucket->datalen for each $bucket.
* @param bool $closingIf the stream is in the process of closing (and therefore this is the last pass through the filterchain), the closing parameter will be set to TRUE * @return int
* The filter() method must return one of * three values upon completion. *
Return Value | *Meaning | *|
---|---|---|
PSFS_PASS_ON | *
* Filter processed successfully with data available in the
* out bucket brigade.
* |
* |
PSFS_FEED_ME | ** Filter processed successfully, however no data was available to * return. More data is required from the stream or prior filter. * | *|
PSFS_ERR_FATAL (default) | ** The filter experienced an unrecoverable error and cannot continue. * | *
parameters | *Description | *
"tm_sec" | *Seconds after the minute (0-61) | *
"tm_min" | *Minutes after the hour (0-59) | *
"tm_hour" | *Hour since midnight (0-23) | *
"tm_mday" | *Day of the month (1-31) | *
"tm_mon" | *Months since January (0-11) | *
"tm_year" | *Years since 1900 | *
"tm_wday" | *Days since Sunday (0-6) | *
"tm_yday" | *Days since January 1 (0-365) | *
"unparsed" | *the date part which was not * recognized using the specified format | *
* The input string. *
* @param int $width [optional]* The number of characters at which the string will be wrapped. *
* @param string $break [optional]* The line is broken using the optional * break parameter. *
* @param bool $cut_long_words [optional]* If the cut is set to true, the string is * always wrapped at or before the specified width. So if you have * a word that is larger than the given width, it is broken apart. * (See second example). *
* @return string the given string wrapped at the specified length. */ #[Pure] function wordwrap(string $string, int $width = 75, string $break = "\n", bool $cut_long_words = false): string {} /** * Convert special characters to HTML entities * @link https://php.net/manual/en/function.htmlspecialchars.php * @param string $string* The {@link https://secure.php.net/manual/en/language.types.string.php string} being converted. *
* @param int $flags [optional]* 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 * ENT_COMPAT | ENT_HTML401. *
Constant Name | *Description | *
---|---|
ENT_COMPAT | *Will convert double-quotes and leave single-quotes alone. | *
ENT_QUOTES | *Will convert both double and single quotes. | *
ENT_NOQUOTES | *Will leave both double and single quotes unconverted. | *
ENT_IGNORE | ** Silently discard invalid code unit sequences instead of returning * an empty string. Using this flag is discouraged as it * {@link https://unicode.org/reports/tr36/#Deletion_of_Noncharacters ยป may have security implications}. * | *
ENT_SUBSTITUTE | ** Replace invalid code unit sequences with a Unicode Replacement Character * U+FFFD (UTF-8) or &#FFFD; (otherwise) instead of returning an empty string. * | *
ENT_DISALLOWED | ** Replace invalid code points for the given document type with a * Unicode Replacement Character U+FFFD (UTF-8) or &#FFFD; * (otherwise) instead of leaving them as is. This may be useful, for * instance, to ensure the well-formedness of XML documents with * embedded external content. * | *
ENT_HTML401 | ** Handle code as HTML 4.01. * | *
ENT_XML1 | ** Handle code as XML 1. * | *
ENT_XHTML | ** Handle code as XHTML. * | *
ENT_HTML5 | ** Handle code as HTML 5. * | *
* Defines encoding used in conversion. * If omitted, the default value for this argument is ISO-8859-1 in * versions of PHP prior to 5.4.0, and UTF-8 from PHP 5.4.0 onwards. *
** For the purposes of this function, the encodings * ISO-8859-1, ISO-8859-15, * UTF-8, cp866, * cp1251, cp1252, and * KOI8-R are effectively equivalent, provided the * string itself is valid for the encoding, as * the characters affected by htmlspecialchars() occupy * the same positions in all of these encodings. *
* @param bool $double_encode [optional]* When double_encode is turned off PHP will not * encode existing html entities, the default is to convert everything. *
* @return string The converted string. */ #[Pure] function htmlspecialchars(string $string, int $flags = ENT_QUOTES|ENT_SUBSTITUTE, ?string $encoding = null, bool $double_encode = true): string {} /** * Convert all applicable characters to HTML entities * @link https://php.net/manual/en/function.htmlentities.php * @param string $string* The input string. *
* @param int $flags [optional]* Like htmlspecialchars, the optional second * quote_style parameter lets you define what will * be done with 'single' and "double" quotes. It takes on one of three * constants with the default being ENT_COMPAT: *
Constant Name | *Description | *
ENT_COMPAT | *Will convert double-quotes and leave single-quotes alone. | *
ENT_QUOTES | *Will convert both double and single quotes. | *
ENT_NOQUOTES | *Will leave both double and single quotes unconverted. | *
* Like htmlspecialchars, it takes an optional * third argument charset which defines character * set used in conversion. * Presently, the ISO-8859-1 character set is used as the default. *
* @param bool $double_encode [optional]* When double_encode is turned off PHP will not * encode existing html entities. The default is to convert everything. *
* @return string the encoded string. */ #[Pure] function htmlentities(string $string, int $flags = ENT_QUOTES|ENT_SUBSTITUTE, ?string $encoding, bool $double_encode = true): string {} /** * Convert HTML entities to their corresponding characters * @link https://php.net/manual/en/function.html-entity-decode.php * @param string $string* The input string. *
* @param int $flags [optional]* The optional second quote_style parameter lets * you define what will be done with 'single' and "double" quotes. It takes * on one of three constants with the default being * ENT_COMPAT: *
Constant Name | *Description | *
ENT_COMPAT | *Will convert double-quotes and leave single-quotes alone. | *
ENT_QUOTES | *Will convert both double and single quotes. | *
ENT_NOQUOTES | *Will leave both double and single quotes unconverted. | *
* The ISO-8859-1 character set is used as default for the optional third * charset. This defines the character set used in * conversion. *
* @return string the decoded string. */ #[Pure] function html_entity_decode(string $string, int $flags = ENT_QUOTES|ENT_SUBSTITUTE, ?string $encoding): string {} /** * Convert special HTML entities back to characters * @link https://php.net/manual/en/function.htmlspecialchars-decode.php * @param string $string* The string to decode *
* @param int $flags [optional]* The quote style. One of the following constants: *
Constant Name | *Description | *
ENT_COMPAT | *Will convert double-quotes and leave single-quotes alone * (default) | *
ENT_QUOTES | *Will convert both double and single quotes | *
ENT_NOQUOTES | *Will leave both double and single quotes unconverted | *
* There are two new constants (HTML_ENTITIES, * HTML_SPECIALCHARS) that allow you to specify the * table you want. *
* @param int $flags [optional]* Like the htmlspecialchars and * htmlentities functions you can optionally specify * the quote_style you are working with. * See the description * of these modes in htmlspecialchars. *
* @param string $encoding [optional]* Encoding to use. * If omitted, the default value for this argument is ISO-8859-1 in * versions of PHP prior to 5.4.0, and UTF-8 from PHP 5.4.0 onwards. *
* * ** The following character sets are supported: *
Charset | *Aliases | *Description | *
---|---|---|
ISO-8859-1 | *ISO8859-1 | ** Western European, Latin-1. * | *
ISO-8859-5 | *ISO8859-5 | ** Little used cyrillic charset (Latin/Cyrillic). * | *
ISO-8859-15 | *ISO8859-15 | ** Western European, Latin-9. Adds the Euro sign, French and Finnish * letters missing in Latin-1 (ISO-8859-1). * | *
UTF-8 | ** | * ASCII compatible multi-byte 8-bit Unicode. * | *
cp866 | *ibm866, 866 | ** DOS-specific Cyrillic charset. * | *
cp1251 | *Windows-1251, win-1251, 1251 | ** Windows-specific Cyrillic charset. * | *
cp1252 | *Windows-1252, 1252 | ** Windows specific charset for Western European. * | *
KOI8-R | *koi8-ru, koi8r | ** Russian. * | *
BIG5 | *950 | ** Traditional Chinese, mainly used in Taiwan. * | *
GB2312 | *936 | ** Simplified Chinese, national standard character set. * | *
BIG5-HKSCS | ** | * Big5 with Hong Kong extensions, Traditional Chinese. * | *
Shift_JIS | *SJIS, SJIS-win, cp932, 932 | ** Japanese * | *
EUC-JP | *EUCJP, eucJP-win | ** Japanese * | *
MacRoman | ** | * Charset that was used by Mac OS. * | *
'' | ** | * An empty string activates detection from script encoding (Zend multibyte), * {@link https://php.net/manual/en/ini.core.php#ini.default-charset default_charset} and current * locale {@link https://php.net/manual/en/function.nl-langinfo.php nl_langinfo()} and * {@link https://php.net/manual/en/function.setlocale.php setlocale()}), in this order. Not recommended. * | *
* @return array the translation table as an array. */ #[Pure] function get_html_translation_table( int $table = 0, int $flags = ENT_QUOTES|ENT_SUBSTITUTE, #[PhpStormStubsElementAvailable(from: '7.0')] string $encoding = "UTF-8" ): array {} /** * Calculate the sha1 hash of a string * @link https://php.net/manual/en/function.sha1.php * @param string $stringNote: * * Any other character sets are not recognized. The default encoding will be * used instead and a warning will be emitted. * *
* The input string. *
* @param bool $binary [optional]* If the optional binary is set to true, * then the sha1 digest is instead returned in raw binary format with a * length of 20, otherwise the returned value is a 40-character * hexadecimal number. *
* @return string the sha1 hash as a string. */ #[Pure] function sha1(string $string, bool $binary = false): string {} /** * Calculate the sha1 hash of a file * @link https://php.net/manual/en/function.sha1-file.php * @param string $filename* The filename *
* @param bool $binary [optional]* When true, returns the digest in raw binary format with a length of * 20. *
* @return string|false a string on success, false otherwise. */ #[Pure(true)] function sha1_file(string $filename, bool $binary = false): string|false {} /** * Calculate the md5 hash of a string * @link https://php.net/manual/en/function.md5.php * @param string $string* The string. *
* @param bool $binary [optional]* If the optional raw_output is set to true, * then the md5 digest is instead returned in raw binary format with a * length of 16. *
* @return string the hash as a 32-character hexadecimal number. */ #[Pure] function md5(string $string, bool $binary = false): string {} /** * Calculates the md5 hash of a given file * @link https://php.net/manual/en/function.md5-file.php * @param string $filename* The filename *
* @param bool $binary [optional]* When true, returns the digest in raw binary format with a length of * 16. *
* @return string|false a string on success, false otherwise. */ #[Pure(true)] function md5_file(string $filename, bool $binary = false): string|false {} /** * Calculates the crc32 polynomial of a string * @link https://php.net/manual/en/function.crc32.php * @param string $string* The data. *
* @return int the crc32 checksum of str as an integer..1 */ #[Pure] function crc32(string $string): int {} /** * Parse a binary IPTC block into single tags. * Note: This function does not require the GD image library. * @link https://php.net/manual/en/function.iptcparse.php * @param string $iptc_block* A binary IPTC block. *
* @return array|false an array using the tagmarker as an index and the value as the * value. It returns false on error or if no IPTC data was found. */ #[Pure] function iptcparse(string $iptc_block): array|false {} /** * Embeds binary IPTC data into a JPEG image. * Note: This function does not require the GD image library. * @link https://php.net/manual/en/function.iptcembed.php * @param string $iptc_data* The data to be written. *
* @param string $filename* Path to the JPEG image. *
* @param int $spool* Spool flag. If the spool flag is less than 2 then the JPEG will * be returned as a string. Otherwise the JPEG will be printed to * STDOUT. *
* @return string|bool If spool is less than 2, the JPEG will be returned, or false on * failure. Otherwise returns true on success or false on failure. */ function iptcembed(string $iptc_data, string $filename, int $spool = 0): string|bool {} /** * Get the size of an image * @link https://php.net/manual/en/function.getimagesize.php * @param string $filename* This parameter specifies the file you wish to retrieve information * about. It can reference a local file or (configuration permitting) a * remote file using one of the supported streams. *
* @param array &$image_info [optional]* This optional parameter allows you to extract some extended * information from the image file. Currently, this will return the * different JPG APP markers as an associative array. * Some programs use these APP markers to embed text information in * images. A very common one is to embed * IPTC information in the APP13 marker. * You can use the iptcparse function to parse the * binary APP13 marker into something readable. *
* @return array|false an array with 7 elements. ** Index 0 and 1 contains respectively the width and the height of the image. *
** Some formats may contain no image or may contain multiple images. In these * cases, getimagesize might not be able to properly * determine the image size. getimagesize will return * zero for width and height in these cases. *
** Index 2 is one of the IMAGETYPE_XXX constants indicating * the type of the image. *
** Index 3 is a text string with the correct * height="yyy" width="xxx" string that can be used * directly in an IMG tag. *
** mime is the correspondant MIME type of the image. * This information can be used to deliver images with correct the HTTP * Content-type header: * getimagesize and MIME types *
** channels will be 3 for RGB pictures and 4 for CMYK * pictures. *
** bits is the number of bits for each color. *
** For some image types, the presence of channels and * bits values can be a bit * confusing. As an example, GIF always uses 3 channels * per pixel, but the number of bits per pixel cannot be calculated for an * animated GIF with a global color table. *
** On failure, false is returned. *
*/ #[ArrayShape([0 => "int", 1 => "int", 2 => "int", 3 => "string", "bits" => "int", "channels" => "int", "mime" => "string"])] function getimagesize(string $filename, &$image_info): array|false {} /** * Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype * @link https://php.net/manual/en/function.image-type-to-mime-type.php * @param int $image_type* One of the IMAGETYPE_XXX constants. *
* @return string The returned values are as follows *imagetype | *Returned value | *
IMAGETYPE_GIF | *image/gif | *
IMAGETYPE_JPEG | *image/jpeg | *
IMAGETYPE_PNG | *image/png | *
IMAGETYPE_SWF | *application/x-shockwave-flash | *
IMAGETYPE_PSD | *image/psd | *
IMAGETYPE_BMP | *image/bmp | *
IMAGETYPE_TIFF_II (intel byte order) | *image/tiff | *
* IMAGETYPE_TIFF_MM (motorola byte order) * | *image/tiff | *
IMAGETYPE_JPC | *application/octet-stream | *
IMAGETYPE_JP2 | *image/jp2 | *
IMAGETYPE_JPX | *application/octet-stream | *
IMAGETYPE_JB2 | *application/octet-stream | *
IMAGETYPE_SWC | *application/x-shockwave-flash | *
IMAGETYPE_IFF | *image/iff | *
IMAGETYPE_WBMP | *image/vnd.wap.wbmp | *
IMAGETYPE_XBM | *image/xbm | *
IMAGETYPE_ICO | *image/vnd.microsoft.icon | *
* One of the IMAGETYPE_XXX constant. *
* @param bool $include_dot [optional]* Removed since 8.0. * Whether to prepend a dot to the extension or not. Default to true. *
* @return string|false A string with the extension corresponding to the given image type, or false on failure. */ #[Pure] function image_type_to_extension(int $image_type, bool $include_dot = true): string|false {} /** * Outputs information about PHP's configuration * @link https://php.net/manual/en/function.phpinfo.php * @param int $flags [optional]* The output may be customized by passing one or more of the * following constants bitwise values summed * together in the optional what parameter. * One can also combine the respective constants or bitwise values * together with the or operator. *
**
Name (constant) | *Value | *Description | *
INFO_GENERAL | *1 | ** The configuration line, "php.ini" location, build date, Web * Server, System and more. * | *
INFO_CREDITS | *2 | ** PHP Credits. See also phpcredits. * | *
INFO_CONFIGURATION | *4 | ** Current Local and Main values for PHP directives. See * also ini_get. * | *
INFO_MODULES | *8 | ** Loaded modules and their respective settings. See also * get_loaded_extensions. * | *
INFO_ENVIRONMENT | *16 | ** Environment Variable information that's also available in * $_ENV. * | *
INFO_VARIABLES | *32 | ** Shows all * predefined variables from EGPCS (Environment, GET, * POST, Cookie, Server). * | *
INFO_LICENSE | *64 | ** PHP License information. See also the license FAQ. * | *
INFO_ALL | *-1 | ** Shows all of the above. * | *
* An optional extension name. *
* @return string|false If the optional extension parameter is * specified, phpversion returns the version of that * extension, or false if there is no version information associated or * the extension isn't enabled. */ #[Pure] function phpversion(?string $extension): string|false {} /** * Prints out the credits for PHP * @link https://php.net/manual/en/function.phpcredits.php * @param int $flags [optional]* To generate a custom credits page, you may want to use the * flags parameter. *
**
name | *description | *
CREDITS_ALL | ** All the credits, equivalent to using: CREDITS_DOCS + * CREDITS_GENERAL + CREDITS_GROUP + * CREDITS_MODULES + CREDITS_FULLPAGE. * It generates a complete stand-alone HTML page with the appropriate tags. * | *
CREDITS_DOCS | *The credits for the documentation team | *
CREDITS_FULLPAGE | ** Usually used in combination with the other flags. Indicates * that a complete stand-alone HTML page needs to be * printed including the information indicated by the other * flags. * | *
CREDITS_GENERAL | ** General credits: Language design and concept, PHP 4.0 * authors and SAPI module. * | *
CREDITS_GROUP | *A list of the core developers | *
CREDITS_MODULES | ** A list of the extension modules for PHP, and their authors * | *
CREDITS_SAPI | ** A list of the server API modules for PHP, and their authors * | *
* Although not exhaustive, the possible return values include * aolserver, apache, * apache2filter, apache2handler, * caudium, cgi (until PHP 5.3), * cgi-fcgi, cli, * continuity, embed, * isapi, litespeed, * milter, nsapi, * phttpd, pi3web, roxen, * thttpd, tux, and webjames. *
*/ #[Pure] #[ExpectedValues(['cli', 'phpdbg', 'embed', 'apache', 'apache2handler', 'cgi-fcgi', 'cli-server', 'fpm-fcgi', 'litespeed'])] function php_sapi_name(): string|false {} /** * Returns information about the operating system PHP is running on * @link https://php.net/manual/en/function.php-uname.php * @param string $mode [optional]* mode is a single character that defines what * information is returned: * 'a': This is the default. Contains all modes in * the sequence "s n r v m".
* @return string the description, as a string. */ #[Pure(true)] function php_uname(#[PhpStormStubsElementAvailable(from: '7.0')] string $mode = 'a'): string {} /** * Return a list of .ini files parsed from the additional ini dir * @link https://php.net/manual/en/function.php-ini-scanned-files.php * @return string|false a comma-separated string of .ini files on success. Each comma is * followed by a newline. If the directive --with-config-file-scan-dir wasn't set, * false is returned. If it was set and the directory was empty, an * empty string is returned. If a file is unrecognizable, the file will * still make it into the returned string but a PHP error will also result. * This PHP error will be seen both at compile time and while using * php_ini_scanned_files. */ #[Pure] function php_ini_scanned_files(): string|false {} /** * Retrieve a path to the loaded php.ini file * @link https://php.net/manual/en/function.php-ini-loaded-file.php * @return string|false The loaded "php.ini" path, or false if one is not loaded. * @since 5.2.4 */ #[Pure] function php_ini_loaded_file(): string|false {} /** * String comparisons using a "natural order" algorithm * @link https://php.net/manual/en/function.strnatcmp.php * @param string $string1* The first string. *
* @param string $string2* The second string. *
* @return int Similar to other string comparison functions, this one returns < 0 if * str1 is less than str2; > * 0 if str1 is greater than * str2, and 0 if they are equal. */ #[Pure] function strnatcmp(string $string1, string $string2): int {} /** * Case insensitive string comparisons using a "natural order" algorithm * @link https://php.net/manual/en/function.strnatcasecmp.php * @param string $string1* The first string. *
* @param string $string2* The second string. *
* @return int Similar to other string comparison functions, this one returns < 0 if * str1 is less than str2 > * 0 if str1 is greater than * str2, and 0 if they are equal. */ #[Pure] function strnatcasecmp(string $string1, string $string2): int {} /** * Count the number of substring occurrences * @link https://php.net/manual/en/function.substr-count.php * @param string $haystack* The string to search in *
* @param string $needle* The substring to search for *
* @param int $offset* The offset where to start counting. If the offset is negative, * counting starts from the end of the string. *
* @param int|null $length [optional]* The maximum length after the specified offset to search for the * substring. It outputs a warning if the offset plus the length is * greater than the haystack length. A negative length counts from * the end of haystack. *
* @return int<0,max> This functions returns an integer. */ #[Pure] function substr_count(string $haystack, string $needle, int $offset = 0, ?int $length): int {} /** * Finds the length of the initial segment of a string consisting * entirely of characters contained within a given mask. * @link https://php.net/manual/en/function.strspn.php * @param string $string* The string to examine. *
* @param string $characters* The list of allowable characters to include in counted segments. *
* @param int $offset* The position in subject to * start searching. *
** If start is given and is non-negative, * then strspn will begin * examining subject at * the start'th position. For instance, in * the string 'abcdef', the character at * position 0 is 'a', the * character at position 2 is * 'c', and so forth. *
** If start is given and is negative, * then strspn will begin * examining subject at * the start'th position from the end * of subject. *
* @param int|null $length [optional]* The length of the segment from subject * to examine. *
** If length is given and is non-negative, * then subject will be examined * for length characters after the starting * position. *
** If lengthis given and is negative, * then subject will be examined from the * starting position up to length * characters from the end of subject. *
* @return int the length of the initial segment of str1 * which consists entirely of characters in str2. */ #[Pure] function strspn(string $string, string $characters, int $offset = 0, ?int $length): int {} /** * Find length of initial segment not matching mask * @link https://php.net/manual/en/function.strcspn.php * @param string $string* The first string. *
* @param string $characters* The second string. *
* @param int $offset* The start position of the string to examine. *
* @param int|null $length [optional]* The length of the string to examine. *
* @return int the length of the segment as an integer. */ #[Pure] function strcspn(string $string, string $characters, int $offset = 0, ?int $length): int {} /** * Tokenize string * Note that only the first call to strtok uses the string argument. * Every subsequent call to strtok only needs the token to use, as it keeps track of where it is in the current string. * To start over, or to tokenize a new string you simply call strtok with the string argument again to initialize it. * Note that you may put multiple tokens in the token parameter. * The string will be tokenized when any one of the characters in the argument are found. * @link https://php.net/manual/en/function.strtok.php * @param string $string* The string being split up into smaller strings (tokens). *
* @param string|null $token* The delimiter used when splitting up str. *
* @return string|false A string token. */ function strtok( string $string, #[PhpStormStubsElementAvailable(from: '5.3', to: '7.0')] $token, #[PhpStormStubsElementAvailable(from: '7.1')] ?string $token = null ): string|false {}