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