3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump($r = idn_to_ascii( 'ශ්‍රී.com', IDNA_USE_STD3_RULES | IDNA_NONTRANSITIONAL_TO_ASCII | IDNA_CHECK_CONTEXTJ, INTL_IDNA_VARIANT_UTS46, $info )); var_dump($info); var_dump(idn_to_utf8($r, IDNA_USE_STD3_RULES, INTL_IDNA_VARIANT_UTS46, $info)); var_dump($info);
based on SPAcM
Output for 5.4.11 - 5.4.45, 5.6.0 - 7.3.1
string(20) "xn--10cl1a0b660p.com" array(3) { ["result"]=> string(20) "xn--10cl1a0b660p.com" ["isTransitionalDifferent"]=> bool(true) ["errors"]=> int(0) } string(19) "ශ්‍රී.com" array(3) { ["result"]=> string(19) "ශ්‍රී.com" ["isTransitionalDifferent"]=> bool(false) ["errors"]=> int(0) }
Output for 5.3.21 - 5.3.29, 5.5.0 - 5.5.38
Fatal error: Call to undefined function idn_to_ascii() in /in/NEp2f on line 3
Process exited with code 255.