php-src/ext/pcre/tests/locales.phpt
Hannes Magnusson 703e08015d Fix test
2006-06-26 23:42:43 +00:00

27 lines
581 B
PHP

--TEST--
Localized match
--SKIPIF--
<?php if (!function_exists('setlocale')) die('skip: setlocale() not available'); ?>
--FILE--
<?php
declare(encoding=latin1);
// this tests if the cache is working correctly, as the char tables
// must be rebuilt after the locale change
setlocale(LC_ALL, 'C', 'POSIX');
var_dump(preg_match('/^\w{6}$/', 'aàáçéè'));
setlocale(LC_ALL, 'pt_PT', 'pt', 'pt_PT.ISO8859-1', 'portuguese');
var_dump(preg_match('/^\w{6}$/', 'aàáçéè'));
setlocale(LC_ALL, 'C', 'POSIX');
var_dump(preg_match('/^\w{6}$/', 'aàáçéè'));
?>
--EXPECT--
int(0)
int(1)
int(0)