Changelog

The following changes have been made to classes/functions/methods of this extension.

VersionFunctionDescription
8.2.0lcfirstCase conversion no longer depends on the locale set with setlocale. Only ASCII characters will be converted.
 str_ireplaceCase 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_splitIf string is empty an empty array is now returned. Previously an array containing a single empty string was returned.
 strcasecmpThis function now returns -1 or 1, where it previously returned a negative or positive number.
 strcmpThis function now returns -1 or 1, where it previously returned a negative or positive number.
 striposCase 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.
 stristrCase 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.
 strnatcasecmpThis function now returns -1 or 1, where it previously returned a negative or positive number.
 strnatcmpThis function now returns -1 or 1, where it previously returned a negative or positive number.
 strncasecmpThis function now returns -1 or 1, where it previously returned a negative or positive number.
 strncmpThis function now returns -1 or 1, where it previously returned a negative or positive number.
 strriposCase 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.
 strtolowerCase conversion no longer depends on the locale set with setlocale. Only ASCII characters will be converted.
 strtoupperCase conversion no longer depends on the locale set with setlocale. Only ASCII characters will be converted.
 substr_compareThis function now returns -1 or 1, where it previously returned a negative or positive number.
 ucfirstCase conversion no longer depends on the locale set with setlocale. Only ASCII characters will be converted.
 ucwordsCase conversion no longer depends on the locale set with setlocale. Only ASCII characters will be converted.
 utf8_decodeThis function has been deprecated.
 utf8_encodeThis function has been deprecated.
8.1.0get_html_translation_tableflags changed from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401.
 html_entity_decodeflags changed from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401.
 htmlentitiesflags changed from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401.
 htmlspecialcharsflags changed from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401.
 htmlspecialchars_decodeflags changed from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401.
8.0.0convert_uuencodePrior to this version, trying to convert an empty string returned false for no particular reason.
 count_charsPrior to this version, the function returned false on failure.
 cryptThe salt is no longer optional.
 explodeexplode will now throw ValueError when separator parameter is given an empty string (""). Previously, explode returned false instead.
 html_entity_decodeencoding is nullable now.
 htmlentitiesencoding is nullable now.
 implodePassing the separator after the array is no longer supported.
 levenshteinPrior to this version, levenshtein had to be called with either two or five arguments.
 levenshteinPrior to this version, levenshtein would return -1 if one of the argument strings is longer than 255 characters.
 metaphoneThe function returned false on failure.
 number_formatPrior to this version, number_format accepted one, two, or four parameters (but not three).
 parse_strresult is no longer optional.
 soundexPrior to this version, calling the function with an empty string returned false for no particular reason.
 sprintfThis function no longer returns false on failure.
 str_splitIf 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_countcharacters is nullable now.
 strcspnlength is nullable now.
 strip_tagsallowed_tags is nullable now.
 striposPassing an int as needle is no longer supported.
 stristrPassing an int as needle is no longer supported.
 strposPassing an int as needle is no longer supported.
 strrchrPassing an int as needle is no longer supported.
 strriposPassing an int as needle is no longer supported.
 strrposPassing an int as needle is no longer supported.
 strspnlength is nullable now.
 strstrPassing an int as needle is no longer supported.
 substrlength 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.
 substrThe function returns an empty string where it previously returned false.
 substr_comparelength is nullable now.
 substr_countlength is nullable now.
 substr_replacelength is nullable now.
 vsprintfThis function no longer returns false on failure.
7.4.0chrThe function no longer silently accepts unsupported codepoints, and casts these to 0.
 implodePassing the separator after the array (i.e. using the legacy signature) has been deprecated.
 money_formatThis function has been deprecated. Instead, use NumberFormatter::formatCurrency.
 str_getcsvThe 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_tagsThe allowed_tags now alternatively accepts an array.
7.3.0striposPassing an int as needle has been deprecated.
 stristrPassing an int as needle has been deprecated.
 strposPassing an int as needle has been deprecated.
 strrchrPassing an int as needle has been deprecated.
 strriposPassing an int as needle has been deprecated.
 strrposPassing an int as needle has been deprecated.
 strstrPassing an int as needle has been deprecated.
7.2.18, 7.3.5substr_compareoffset may now be equal to the length of haystack.
7.2.0number_formatnumber_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_strUsage of parse_str without a second parameter now emits an E_DEPRECATED notice.
 utf8_decodeThis 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_encodeThis 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.0str_shuffleThe internal randomization algorithm has been changed to use the Mersenne Twister Random Number Generator instead of the libc rand function.
 striposSupport for negative offsets has been added.
 strposSupport for negative offsets has been added.
 substr_countSupport for negative offsets and lengths has been added. length may also be 0 now.
add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top