bug72506.phpt 989 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. Bug #72506 (idn_to_ascii with INTL_IDNA_VARIANT_UTS46 fatals for long domain names)
  3. --DESCRIPTION--
  4. Actually, the $info array should be populated for these cases, but at least it's
  5. not clear yet with which values exactly.
  6. --EXTENSIONS--
  7. intl
  8. --SKIPIF--
  9. <?php
  10. if (!defined('INTL_IDNA_VARIANT_UTS46')) die('skip no UTS #46 API');
  11. ?>
  12. --FILE--
  13. <?php
  14. // ASCII domain name with 255 characters
  15. $domain = str_repeat('a.', 126) . 'aaa';
  16. $result = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46, $info);
  17. var_dump($result, $info);
  18. // ASCII domain name with 256 characters – one character added
  19. $domain .= 'a';
  20. $result = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46, $info);
  21. var_dump($result, $info);
  22. // International domain name with cyrillic "ф" characters
  23. $domain = str_repeat('ф.', 32) . 'a';
  24. $result = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46, $info);
  25. var_dump($result, $info);
  26. ?>
  27. --EXPECT--
  28. bool(false)
  29. array(0) {
  30. }
  31. bool(false)
  32. array(0) {
  33. }
  34. bool(false)
  35. array(0) {
  36. }