<?php
$value = str_repeat('a.', 126) . 'aa'; // 254 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/CijFV:4
Stack trace:
#0 {main}
thrown in /in/CijFV on line 4
Process exited with code 255.
Output for 5.5.0 - 5.5.38
Fatal error: Call to undefined function idn_to_ascii() in /in/CijFV on line 4
Process exited with code 255.