<?php
$value = str_repeat('ф.', 31) . 's.s.s.s'; // "ф" is cyrillic symbol, only 38 characters, but after conversion to ASCII will be much more
$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/EUSlJ:4
Stack trace:
#0 {main}
thrown in /in/EUSlJ on line 4
Process exited with code 255.