xref: /PHP-5.5/ext/pcre/tests/locales.phpt (revision ade487e6)
1--TEST--
2Localized match
3--SKIPIF--
4<?php
5
6if (!function_exists('setlocale')) die('skip: setlocale() not available');
7if (!@setlocale(LC_ALL, 'pt_PT', 'pt', 'pt_PT.ISO8859-1', 'portuguese')) die('skip pt locale not available');
8
9?>
10--FILE--
11<?php
12
13// this tests if the cache is working correctly, as the char tables
14// must be rebuilt after the locale change
15
16setlocale(LC_ALL, 'C', 'POSIX');
17var_dump(preg_match('/^\w{6}$/', 'a�����'));
18
19setlocale(LC_ALL, 'pt_PT', 'pt', 'pt_PT.ISO8859-1', 'portuguese');
20var_dump(preg_match('/^\w{6}$/', 'a�����'));
21
22setlocale(LC_ALL, 'C', 'POSIX');
23var_dump(preg_match('/^\w{6}$/', 'a�����'));
24
25?>
26--EXPECT--
27int(0)
28int(1)
29int(0)
30