How to determine Unicode version in PHP and PCRE?

Unicode 7.0.0 was released in June 2014. It will take some time for PCRE to turn this on, and another for PHP to turn on the updated PCRE library. The current version of Unicode in PCRE / PHP is 6.3.0 as of July 2014. Is there a way to determine which version of Unicode is used with a PHP script? phpinfo()silent on this issue.

Does the Unicode version have anything other than PCRE? I don’t see how this will affect other libraries, such as mb_string, because (as far as I know) they don’t care if the code point is assigned or not or what properties it has (block, script, letter, character, etc. )

+4
source share
2 answers

I was in contact with the PCRE maintainer, and he tells me that he has no function to return the version of Unicode with which it was compiled. Therefore, PHP also can not say. It will add this functionality to some future version of PCRE, but cannot promise when.

+2
source

PCRE_VERSIONmay help if you ignore the custom build option ( --with-pcre-regex=DIR) and the patch.

> php -r 'echo PCRE_VERSION, PHP_EOL;'
> 8.34 2013-12-15

The following table shows the correspondence between the versions of PHP and PCRE and Unicode.

PHP                     | PCRE | Unicode
-----------------------------------------
5.5.10                  |8.34  | 6.3.0
5.5.0 / 5.4.14 / 5.3.24 |8.32  | 6.2.0
5.4.9 / 5.3.19  8.31    |8.31  | 6.1.0
5.3.0                   |7.9   | 5.1.0

Unicode | PCRE
-------------------
7.0.0   | 8.36
6.3.0   | 8.34, 8.35
6.2.0   | 8.32
6.1.0   | 8.31
6.0.0   | 8.13, 8.20, 8.21, 8.30
5.2.0   | 8.02, 8.10, 8.11, 8.12
5.1.0   | 7.9, 8.0
5.0.0   | 7.0

Source

+2
source

Source: https://habr.com/ru/post/1547289/


All Articles