Bug #75609 [Nab]: idn_to_utf8() default of INTL_IDNA_VARIANT_2003 gives deprecation warning
Edit report at https://bugs.php.net/bug.php?id=75609&edit=1
ID: 75609
User updated by: hanno at hboeck dot de
Reported by: hanno at hboeck dot de
Summary: idn_to_utf8() default of INTL_IDNA_VARIANT_2003
gives deprecation warning
Status: Not a bug
Type: Bug
Package: I18N and L10N related
Operating System: Linux
PHP Version: 7.2.0
Block user comment: N
Private report: N
New Comment:
Sorry, but that seems like a terribly illogical strategy.
The majority of users of that function will want to use "the default", whatever that is at
a certain point in time.
With that plan of *first* introducing a deprecation warning for the default and only two major
versions later changing the default you get this situation:
* Applications that use the function in its default way will get a deprecation warning.
* They will eventually explicitly set the variant to avoid the warning.
* Some years later they can remove that again when PHP 7.4 is the default.
* Many of course won't, so should there be any other default in the future the confusion starts
again.
How does that make any sense?
The sensible approach would be to change the default and introduce the warning at the same time.
Previous Comments:
------------------------------------------------------------------------
[2017-12-01 12:34:21] kelunik@php.net
This is not a bug, but intended, see https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003
This makes it explicit for users of the old variant that the behavior of their code will change in a
future version.
------------------------------------------------------------------------
[2017-12-01 12:26:28] hanno at hboeck dot de
Description:
------------
The variant parameter of idn_to_utf8() defaults to INTL_IDNA_VARIANT_2003. This gives a deprecation
warning in PHP 7.2. Example:
php7.2 -ddisplay_errors=on -r 'error_reporting(E_DEPRECATED);idn_to_utf8("x");'
Deprecated: idn_to_utf8(): INTL_IDNA_VARIANT_2003 is deprecated in Command line code on line 1
If INTL_IDNA_VARIANT_2003 is considered deprecated it shouldn't be the default.
Test script:
---------------
error_reporting(E_DEPRECATED);
idn_to_utf8("x");
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75609&edit=1
Thread (3 messages)