PHP 7.4: new NewIDNVariantDefault sniff by jrfnl · Pull Request #861 · PHPCompatibility/PHPCompatibility
Intl:
The default parameter value of idn_to_ascii() and idn_to_utf8() is now
INTL_IDNA_VARIANT_UTS46 instead of the deprecated INTL_IDNA_VARIANT_2003.
Note: The new sniff will only throw an error when the testVersion indicates that both PHP < 7.4 as well as PHP 7.4+ need to be supported.
There is a risk in that, i.e. when people use PHPCompatibility against their code using only their current server version, 7.2, and when upgrading the server version, only the new version, 7.4, they will not be shown this message in either run.
The other side of that coin is that it prevents unnecessary errors/warnings for code which only needs to support one PHP version and is therefore not directly affected by this change.
This should possibly be addressed in the Readme by advising people to use a testVersion spanning both the old and the new server version, 7.2-7.4 when they are testing if their server can safely be upgraded.
Refs:
- https://github.com/php/php-src/blob/86d751f696786bcb95c580482c9884e41ccf2406/UPGRADING#L66-L68
- https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003
- https://www.php.net/manual/en/function.idn-to-ascii.php
- https://www.php.net/manual/en/function.idn-to-utf8.php
- php/php-src@01912f9
Related to #808