locales.phpt 591 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Localized match
  3. --SKIPIF--
  4. <?php
  5. if (!@setlocale(LC_ALL, 'pt_PT', 'pt', 'pt_PT.ISO8859-1', 'portuguese')) die('skip pt locale not available');
  6. ?>
  7. --FILE--
  8. <?php
  9. // this tests if the cache is working correctly, as the char tables
  10. // must be rebuilt after the locale change
  11. setlocale(LC_ALL, 'C', 'POSIX');
  12. var_dump(preg_match('/^\w{6}$/', 'aàáçéè'));
  13. setlocale(LC_ALL, 'pt_PT', 'pt', 'pt_PT.ISO8859-1', 'portuguese');
  14. var_dump(preg_match('/^\w{6}$/', 'aàáçéè'));
  15. setlocale(LC_ALL, 'C', 'POSIX');
  16. var_dump(preg_match('/^\w{6}$/', 'aàáçéè'));
  17. ?>
  18. --EXPECT--
  19. int(0)
  20. int(1)
  21. int(0)