idn_to_ascii

FunctionParams and return types changed in PHP 8.0
PHP 5
PHP 7
PHP 8.0
Improved
PHP 8.1
PHP 8.2-8.3
PHP 8.4
PHP 8.5
PHP 8.6

idn_to_ascii Function synopsis

idn_to_ascii(
    string $domain,
    int $flags = IDNA_DEFAULT,
    int $variant = INTL_IDNA_VARIANT_UTS46,
    &$idna_info = null
  ): string|false

Parameters

$domain

Typestring

$flags

OptionalTypeintDefault valueIDNA_DEFAULT

$flags accepts one or a bitmask of the following constant values:

$variant

OptionalTypeintDefault valueINTL_IDNA_VARIANT_UTS46

$variant accepts one of the following constant values:

$idna_info

Passed by reference, OptionalDefault valuenull

Note that the parameter $idna_info is passed by reference, and contains additional/updated context data that may be useful.

Return value

Typestring|false

Changes to the idn_to_ascii Function

PHP 8.0

  • Return type added: string|false
  • Parameter type added for parameter #1 ($domain): string
  • Parameter name of parameter #2 changed: $option to $flags
  • Parameter type added for parameter #2 ($flags): int
  • Parameter default value added for position #2 ($flags): IDNA_DEFAULT
  • Parameter type added for parameter #3 ($variant): int
  • Parameter default value added for position #3 ($variant): INTL_IDNA_VARIANT_UTS46
  • Parameter name of parameter #4 changed: $idn_info to $idna_info
  • Parameter default value added for position #4 ($idna_info): null
  idn_to_ascii(
-     $domain,
+     string $domain,
-     $option,
+     int $flags = IDNA_DEFAULT,
-     $variant,
+     int $variant = INTL_IDNA_VARIANT_UTS46,
-     &$idn_info
+     &$idna_info = null
-   )
+   ): string|false

PHP 5.4

  • Optional parameter added - #4: &$idn_info
 idn_to_ascii(
     $domain,
     $option,
-    $status
+    $variant,
+    &$idn_info
   )

idn_to_ascii Function Availability

PHP VersionAvailability
PHP 8.6Upcoming Release Yes
PHP 8.5Supported (Latest) Yes
PHP 8.4Supported Yes
PHP 8.3Security-Fixes Only Yes
PHP 8.2Security-Fixes Only Yes
PHP 8.1Unsupported Yes
PHP 8.0Unsupported Yes
PHP 7.4Unsupported Yes
PHP 7.3Unsupported Yes
PHP 7.2Unsupported Yes
PHP 7.1Unsupported Yes
PHP 7.0Unsupported Yes
PHP 5.6Unsupported Yes
PHP 5.5Unsupported Yes
PHP 5.4Unsupported Yes
PHP 5.3Unsupported Yes