|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2019-04-24 20:33 UTC] v-altruo at microsoft dot com
 Description:
------------
Failed regardless of OPCache being enabled or disabled and if it was TS or NTS. 
Test file location: ext\pcre\tests\locales.phpt
Test script:
---------------
setlocale(LC_ALL, 'pt_PT', 'pt', 'pt_PT.ISO8859-1', 'portuguese');
var_dump(preg_match('/^\w{6}$/', 'aאבחיט'));
Expected result:
----------------
int(1)
Actual result:
--------------
int(0)
PatchesPull Requests
Pull requests: 
 HistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 18:00:01 2025 UTC | 
This issue is neither directly PCRE nor testing related. Consider the following script: <?php var_dump(17.4); var_dump(setlocale(LC_ALL, 'pt_PT')); var_dump(17.5); var_dump(ctype_alpha(224)); ?> This outputs on my Windows system: float(17.4) string(5) "pt_PT" float(17,5) bool(false) The first three lines indicate that pt_PT is properly supported, but the failing ctype_alpha() shows that it is not really. The following C program confirms that the issue is not directly related to PHP: #include <stdio.h> #include <ctype.h> #include <locale.h> int main() { struct lconv *lc1 = localeconv(); char *loc = setlocale(LC_ALL, "pt_PT"); struct lconv *lc2 = localeconv(); int alpha = isalpha(224); printf("%s %s %s %d\n", lc1->decimal_point, loc, lc2->decimal_point, alpha); return 0; } Outputs on my Windows system (when built with VC15): . pt_PT , 0 Again, ctype fails to properly recognize the locale (which is the reason for the failing test, since PCRE2 calls ctype functions to build the character tables). If I build with VC11, I get: . (null) . 0 Apparently, AppVeyor behaves either like this, or it properly recognizes pt_PT for the ctype functions.