bug74484_MessageFormatter.phpt 645 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. Bug #74484 MessageFormatter::formatMessage memory corruption with 11+ named placeholder
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded('intl'))
  6. die('skip intl extension not enabled');
  7. if (version_compare(INTL_ICU_VERSION, '4.8') < 0)
  8. die('skip for ICU 4.8+');
  9. ?>
  10. --FILE--
  11. <?php
  12. $text = "{a} {b} {c} {d} {e} {f} {g} {h} {i} {j} {k} {l}";
  13. $vars = array(
  14. 'a' => 1,
  15. 'b' => 2,
  16. 'c' => 3,
  17. 'd' => 4,
  18. 'e' => 5,
  19. 'f' => 6,
  20. 'g' => 7,
  21. 'h' => 8,
  22. 'i' => 9,
  23. 'j' => 10,
  24. 'k' => 11,
  25. 'l' => 12
  26. );
  27. var_dump(MessageFormatter::formatMessage('en_US', $text, $vars));
  28. ?>
  29. ==DONE==
  30. --EXPECT--
  31. string(26) "1 2 3 4 5 6 7 8 9 10 11 12"
  32. ==DONE==