<?php
$value = str_repeat('a.', 126) . 'aaa'; // 255 characters, max allowed is 253, trailing dot ignored
$result = idn_to_ascii($value, 0, INTL_IDNA_VARIANT_UTS46, $idnaInfo);
var_dump($result);
var_dump($idnaInfo);
// $idnaInfo['errors'] should be equal to 4, it is value of IDNA_ERROR_DOMAIN_NAME_TOO_LONG
Fatal error: Uncaught Error: Call to undefined function idn_to_ascii() in /in/tuM9l:4
Stack trace:
#0 {main}
thrown in /in/tuM9l on line 4
Process exited with code 255.
Output for 5.6.0 - 5.6.24, 7.0.0 - 7.0.9
Fatal error: idn_to_ascii(): ICU returned an unexpected length in /in/tuM9l on line 4
Process exited with code 255.