3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(idn_to_ascii( "oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooloooooooooooooooooong.org", IDNA_USE_STD3_RULES | IDNA_NONTRANSITIONAL_TO_ASCII | IDNA_CHECK_CONTEXTJ, INTL_IDNA_VARIANT_UTS46, $info )); var_dump($info); $errors = [ "IDNA_ERROR_EMPTY_LABEL", "IDNA_ERROR_LABEL_TOO_LONG", "IDNA_ERROR_DOMAIN_NAME_TOO_LONG", "IDNA_ERROR_LEADING_HYPHEN", "IDNA_ERROR_TRAILING_HYPHEN", "IDNA_ERROR_HYPHEN_3_4", "IDNA_ERROR_LEADING_COMBINING_MARK", "IDNA_ERROR_DISALLOWED", "IDNA_ERROR_PUNYCODE", "IDNA_ERROR_LABEL_HAS_DOT", "IDNA_ERROR_INVALID_ACE_LABEL", "IDNA_ERROR_BIDI", "IDNA_ERROR_CONTEXTJ" ]; foreach($errors as $errorReadable){ $error = constant($errorReadable); if($info['errors'] & $error){ echo $errorReadable . "\n"; } }
based on 6NDVo
Output for 5.4.11 - 5.4.45, 5.6.0 - 7.3.1
bool(false) array(3) { ["result"]=> string(110) "oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooloooooooooooooooooong.org" ["isTransitionalDifferent"]=> bool(false) ["errors"]=> int(2) } IDNA_ERROR_LABEL_TOO_LONG
Output for 5.5.0 - 5.5.38
Fatal error: Call to undefined function idn_to_ascii() in /in/hWZ44 on line 3
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/hWZ44 on line 12
Process exited with code 255.