Changelog - Version 7.0
Status: in development. This document tracks changes landing on the
7.0branch. Nothing here is released yet, and the contents may still change.
Breaking Changes
-
FromUTF8::toIso88591Email()was removed. It was deprecated; usetoMimeEncodedWord(). -
The conversions now use PHP's own functions instead of hand-maintained tables (about 2,300 lines removed). The method names and signatures are unchanged, but some outputs change:
Method Now Visible change ToUTF8::fromHtmlEntities()html_entity_decode(..., ENT_QUOTES | ENT_HTML5)Decodes every HTML5 entity, including &,<,>,"and hex ones (A), which were left as they were. gives U+00A0 instead of a plain space.Ũ/ũare not decoded: they are not HTML entities.FromUTF8::toHtmlEntities()htmlentities()+mb_encode_numericentity()Characters with no named entity are written as numeric ones ( ũ→ũ,✓→✓) instead ofũor?, so the output is always ASCII.&,<and>are still left as they are.FromUTF8::toMimeEncodedWord()mb_encode_mimeheader(..., 'UTF-8', 'Q')=?UTF-8?Q?...?=instead of=?utf-8?Q?...?=, a space is=20instead of_, only the words that need it are encoded, and a long text is folded into several lines. Mail clients decode both the same way.ToUTF8::fromCombiningChar()Normalizer::normalize(..., FORM_C)Composes every combination Unicode defines ( z+ˇ→ž), not only the 55 Latin-1 ones.FromUTF8::removeEmoji()\p{Extended_Pictographic}regexRemoves emoji added in newer Unicode versions and any flag. Everything the old list removed is still removed. A text that is not valid UTF-8 is returned unchanged. -
FromUTF8::removeAccent()writes the letters with no accented form correctly:ß→ss,Ø/ø→O/o,Þ/þ→TH/th,ð→d(they wereB,0,P/pando). -
FromUTF8::removeAccent()works on every Latin letter, not only the Latin-1 ones, using the Unicode decomposition (Normalizer):Škoda Dvořák Việt Nam→Skoda Dvorak Viet Nam(it was?koda Dvo?ak Việt Nam). A letter followed by a combining mark (e+ U+0301) loses the mark too.Œ/œ,Ł/ł,Đ/đandıare written asOE/oe,L/l,D/dandi.What it does not convert is now left as it is instead of becoming
?: other scripts, symbols such as€,✓,“and–, and the emoji☹️and❤️. A text that is not valid UTF-8 is returned unchanged.onlyAscii()therefore replaces those characters with its own$defaultChar:onlyAscii('€5')returns5, not?5. -
The protected
FromUTF8::baseConversion()was removed with the byte table it walked. -
FromUTF8::onlyAscii()replaces each character with one$defaultChar:onlyAscii('世界', '?')returns??, not??????(it was one per byte). Tabs and line breaks are no longer removed. The return type isstringinstead of?string.
Bug Fixes
ToUTF8::fromEmoji()converts>:(,>:-(,O:),O:-),>:)and>:-). They used to be read as>orOfollowed by:(or:).
Requirements
- PHP 8.3, 8.4, 8.5 and 8.6 are now supported:
"php": ">=8.3 <8.7". The previous<8.6upper bound excluded PHP 8.6, since<8.6is exclusive. - The
intlandmbstringextensions are now required.
Toolchain
-
PHPUnit updated to
^12.5. -
Psalm is installed as
psalm/phar(^6.16) instead ofvimeo/psalm.vimeo/psalmlists the PHP versions it supports and no published release includes 8.6, so as a dev dependency it madecomposer installfail on the 8.6 build job before any test ran.psalm/pharrequires onlyphp ^8.2and bundles its own dependencies, so it installs on every PHP version in the matrix and cannot conflict with the project's. Psalm itself still refuses to run on 8.6, which is why the Psalm job uses 8.5.composer psalmruns it.PHPUnit 13 is deliberately not used. It requires PHP
>=8.4.1, which would break the 8.3 floor.
Continuous Integration
- The build matrix now includes PHP 8.6.
- The Psalm job now runs on PHP 8.5. Psalm declares
~8.1.31 || ~8.2.27 || ~8.3.16 || ~8.4.3 || ~8.5.0and therefore does not run on PHP 8.6.
Housekeeping
phpunit.xml.distrenamed tophpunit.xml.- The
gen/scripts that generated the conversion tables were removed, along with the tables.