summaryrefslogtreecommitdiff
path: root/ext/pcre/tests/locales.phpt
blob: a1030204eedd8b556dd54a72fa3591491a56979c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--TEST--
Localized match
--SKIPIF--
<?php 

if (!function_exists('setlocale')) die('skip: setlocale() not available');
if (!@setlocale(LC_ALL, 'pt_PT', 'pt', 'pt_PT.ISO8859-1', 'portuguese')) die('skip pt locale not available');

?>
--FILE--
<?php

// 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)