The following changes have been made to classes/functions/methods of this extension.
Version | Function | Description |
---|---|---|
8.4.0 | str_getcsv | Relying on the default value of escape is now deprecated. |
str_getcsv | Now throws a ValueError if separator, enclosure, or escape is invalid. This mimics the behavior of fgetcsv and fputcsv. | |
strcspn | Prior to PHP 8.4.0, when characters was the empty string, the search would incorrectly stop at the first null byte in string. | |
8.3.0 | number_format | Added handling of negative values for decimals. |
str_getcsv | An empty string is returned instead of a string with a single null byte for the last field if it contains only an unterminated enclosure. | |
strrchr | The before_needle parameter was added. | |
strtok | Now emits E_WARNING when token is not provided. | |
8.2.0 | lcfirst | Case conversion no longer depends on the locale set with setlocale. Only ASCII characters will be converted. |
str_ireplace | Case folding no longer depends on the locale set with setlocale. Only ASCII case folding will be done. Non-ASCII bytes will be compared by their byte value. | |
str_split | If string is empty an empty array is now returned. Previously an array containing a single empty string was returned. | |
strcasecmp | This function now returns -1 or 1, where it previously returned a negative or positive number. | |
strcmp | This function now returns -1 or 1, where it previously returned a negative or positive number. | |
stripos | Case folding no longer depends on the locale set with setlocale. Only ASCII case folding will be done. Non-ASCII bytes will be compared by their byte value. | |
stristr | Case folding no longer depends on the locale set with setlocale. Only ASCII case folding will be done. Non-ASCII bytes will be compared by their byte value. | |
strnatcasecmp | This function now returns -1 or 1, where it previously returned a negative or positive number. | |
strnatcmp | This function now returns -1 or 1, where it previously returned a negative or positive number. | |
strncasecmp | This function now returns -1 or 1, where it previously returned a negative or positive number. | |
strncmp | This function now returns -1 or 1, where it previously returned a negative or positive number. | |
strripos | Case folding no longer depends on the locale set with setlocale. Only ASCII case folding will be done. Non-ASCII bytes will be compared by their byte value. | |
strtolower | Case conversion no longer depends on the locale set with setlocale. Only ASCII characters will be converted. | |
strtoupper | Case conversion no longer depends on the locale set with setlocale. Only ASCII characters will be converted. | |
substr_compare | This function now returns -1 or 1, where it previously returned a negative or positive number. | |
ucfirst | Case conversion no longer depends on the locale set with setlocale. Only ASCII characters will be converted. | |
ucwords | Case conversion no longer depends on the locale set with setlocale. Only ASCII characters will be converted. | |
utf8_decode | This function has been deprecated. | |
utf8_encode | This function has been deprecated. | |
8.1.0 | get_html_translation_table | flags changed from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401. |
html_entity_decode | flags changed from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401. | |
htmlentities | flags changed from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401. | |
htmlspecialchars | flags changed from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401. | |
htmlspecialchars_decode | flags changed from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401. | |
8.0.0 | convert_uuencode | Prior to this version, trying to convert an empty string returned false for no particular reason. |
count_chars | Prior to this version, the function returned false on failure. | |
crypt | The salt is no longer optional. | |
explode | explode will now throw ValueError when separator parameter is given an empty string (""). Previously, explode returned false instead. | |
fprintf | This function no longer returns false on failure. | |
fprintf | Throw a ValueError if the number of arguments is zero; previously this function emitted a E_WARNING instead. | |
fprintf | Throw a ValueError if [width] is less than zero or bigger than PHP_INT_MAX; previously this function emitted a E_WARNING instead. | |
fprintf | Throw a ValueError if [precision] is less than zero or bigger than PHP_INT_MAX; previously this function emitted a E_WARNING instead. | |
fprintf | Throw a ArgumentCountError when less arguments are given than required; previously this function emitted a E_WARNING instead. | |
html_entity_decode | encoding is nullable now. | |
htmlentities | encoding is nullable now. | |
implode | Passing the separator after the array is no longer supported. | |
levenshtein | Prior to this version, levenshtein had to be called with either two or five arguments. | |
levenshtein | Prior to this version, levenshtein would return -1 if one of the argument strings is longer than 255 characters. | |
metaphone | The function returned false on failure. | |
number_format | Prior to this version, number_format accepted one, two, or four parameters (but not three). | |
parse_str | result is no longer optional. | |
printf | This function no longer returns false on failure. | |
printf | Throw a ValueError if the number of arguments is zero; previously this function emitted a E_WARNING instead. | |
printf | Throw a ValueError if [width] is less than zero or bigger than PHP_INT_MAX; previously this function emitted a E_WARNING instead. | |
printf | Throw a ValueError if [precision] is less than zero or bigger than PHP_INT_MAX; previously this function emitted a E_WARNING instead. | |
printf | Throw a ArgumentCountError when less arguments are given than required; previously this function emitted a E_WARNING instead. | |
soundex | Prior to this version, calling the function with an empty string returned false for no particular reason. | |
sprintf | This function no longer returns false on failure. | |
sprintf | Throw a ValueError if the number of arguments is zero; previously this function emitted a E_WARNING instead. | |
sprintf | Throw a ValueError if [width] is less than zero or bigger than PHP_INT_MAX; previously this function emitted a E_WARNING instead. | |
sprintf | Throw a ValueError if [precision] is less than zero or bigger than PHP_INT_MAX; previously this function emitted a E_WARNING instead. | |
sprintf | Throw a ArgumentCountError when less arguments are given than required; previously this function emitted a E_WARNING instead. | |
str_split | If length is less than 1, a ValueError will be thrown now; previously, an error of level E_WARNING has been raised instead, and the function returned false. | |
str_word_count | characters is nullable now. | |
strcspn | length is nullable now. | |
strip_tags | allowed_tags is nullable now. | |
stripos | needle now accepts an empty string. | |
stripos | Passing an int as needle is no longer supported. | |
stristr | needle now accepts an empty string. | |
stristr | Passing an int as needle is no longer supported. | |
strpos | needle now accepts an empty string. | |
strpos | Passing an int as needle is no longer supported. | |
strrchr | needle now accepts an empty string. | |
strrchr | Passing an int as needle is no longer supported. | |
strripos | needle now accepts an empty string. | |
strripos | Passing an int as needle is no longer supported. | |
strrpos | needle now accepts an empty string. | |
strrpos | Passing an int as needle is no longer supported. | |
strspn | length is nullable now. | |
strstr | needle now accepts an empty string. | |
strstr | Passing an int as needle is no longer supported. | |
substr | length is nullable now. When length is explicitly set to null, the function returns a substring finishing at the end of the string, when it previously returned an empty string. | |
substr | The function returns an empty string where it previously returned false. | |
substr_compare | length is nullable now. | |
substr_count | length is nullable now. | |
substr_replace | length is nullable now. | |
vfprintf | This function no longer returns false on failure. | |
vfprintf | Throw a ValueError if the number of arguments is zero; previously this function emitted a E_WARNING instead. | |
vfprintf | Throw a ValueError if [width] is less than zero or bigger than PHP_INT_MAX; previously this function emitted a E_WARNING instead. | |
vfprintf | Throw a ValueError if [precision] is less than zero or bigger than PHP_INT_MAX; previously this function emitted a E_WARNING instead. | |
vfprintf | Throw a ValueError when less arguments are given than required; previously this function emitted a E_WARNING instead. | |
vprintf | This function no longer returns false on failure. | |
vprintf | Throw a ValueError if the number of arguments is zero; previously this function emitted a E_WARNING instead. | |
vprintf | Throw a ValueError if [width] is less than zero or bigger than PHP_INT_MAX; previously this function emitted a E_WARNING instead. | |
vprintf | Throw a ValueError if [precision] is less than zero or bigger than PHP_INT_MAX; previously this function emitted a E_WARNING instead. | |
vprintf | Throw a ValueError when less arguments are given than required; previously this function emitted a E_WARNING instead. | |
vsprintf | This function no longer returns false on failure. | |
vsprintf | Throw a ValueError if the number of arguments is zero; previously this function emitted a E_WARNING instead. | |
vsprintf | Throw a ValueError if [width] is less than zero or bigger than PHP_INT_MAX; previously this function emitted a E_WARNING instead. | |
vsprintf | Throw a ValueError if [precision] is less than zero or bigger than PHP_INT_MAX; previously this function emitted a E_WARNING instead. | |
vsprintf | Throw a ValueError when less arguments are given than required; previously this function emitted a E_WARNING instead. | |
wordwrap | If break is empty string, a ValueError is thrown; previously in this case it emitted an E_WARNING and returned false. | |
7.4.0 | chr | The function no longer silently accepts unsupported codepoints, and casts these to 0. |
implode | Passing the separator after the array (i.e. using the legacy signature) has been deprecated. | |
money_format | This function has been deprecated. Instead, use NumberFormatter::formatCurrency. | |
str_getcsv | The escape parameter now interprets an empty string as signal to disable the proprietary escape mechanism. Formerly, an empty string was treated like the default parameter value. | |
strip_tags | The allowed_tags now alternatively accepts an array. | |
7.3.5 | substr_compare | offset may now be equal to the length of haystack. |
7.3.0 | stripos | Passing an int as needle has been deprecated. |
stristr | Passing an int as needle has been deprecated. | |
strpos | Passing an int as needle has been deprecated. | |
strrchr | Passing an int as needle has been deprecated. | |
strripos | Passing an int as needle has been deprecated. | |
strrpos | Passing an int as needle has been deprecated. | |
strstr | Passing an int as needle has been deprecated. | |
7.2.18 | substr_compare | offset may now be equal to the length of haystack. |
7.2.0 | number_format | number_format was changed to not being able to return -0, previously -0 could be returned for cases like where num would be -0.01. |
parse_str | Usage of parse_str without a second parameter now emits an E_DEPRECATED notice. | |
utf8_decode | This function has been moved from the XML extension to the core of PHP. In previous versions, it was only available if the XML extension was installed. | |
utf8_encode | This function has been moved from the XML extension to the core of PHP. In previous versions, it was only available if the XML extension was installed. | |
7.1.0 | str_shuffle | The internal randomization algorithm has been changed to use the Mersenne Twister Random Number Generator instead of the libc rand function. |
stripos | Support for negative offsets has been added. | |
strpos | Support for negative offsets has been added. | |
substr_count | Support for negative offsets and lengths has been added. length may also be 0 now. |