Skip to content

PHP 7.4: new NewIDNVariantDefault sniff#861

Merged
wimg merged 1 commit intomasterfrom
php-7.4/new-idn-default-variant-sniff
Aug 28, 2019
Merged

PHP 7.4: new NewIDNVariantDefault sniff#861
wimg merged 1 commit intomasterfrom
php-7.4/new-idn-default-variant-sniff

Conversation

@jrfnl
Copy link
Copy Markdown
Member

@jrfnl jrfnl commented Aug 18, 2019

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:

Related to #808

@jrfnl jrfnl added this to the 9.3.0 milestone Aug 18, 2019
@jrfnl jrfnl requested a review from wimg August 18, 2019 15:56
@jrfnl jrfnl force-pushed the php-7.4/new-idn-default-variant-sniff branch 3 times, most recently from 4a012e0 to e4decaf Compare August 21, 2019 05:02
> 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
@jrfnl jrfnl force-pushed the php-7.4/new-idn-default-variant-sniff branch from e4decaf to 4123e3d Compare August 21, 2019 11:21
@wimg wimg merged commit f17f969 into master Aug 28, 2019
@delete-merged-branch delete-merged-branch bot deleted the php-7.4/new-idn-default-variant-sniff branch August 28, 2019 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants