PHP 7 Unicode support and platform independence

PHP 7 has been announced to support "consistent 64-bit" . What does it mean?

Does PHP 7 Unicode support what was planned for PHP 6 (directive unicode.semantics

, etc.)? If not, when will it support Unicode natively?

+3


source to share


2 answers


Consistent 64-bit support

I think this is related to RFC: 64 bit platform enhancements for string length and integer in zval .

It looks like the visible part of the iceberg, as @cybersoft mentioned, is that PHP 7 x64 on Windows now has 64-bit integers, whereas PHP 5.6 x64 still had 32-bit integers on that platform.

There is an RFC for a 64-bit integer type , but it still hasn't worked since 2010, so it looks like we're still not getting a 64-bit integer on 32-bit platforms here.



Unicode support

AFAIK, there is no such thing as a Unicode implementation similar to what was planned for PHP 6. PHP will still be of binary type for the foreseeable future string

, and the RFC for UString , which suggests adding a new type for Unicode strings, is still under discussion. so won't be included in PHP 7.0.

However PHP still works well with UTF-8 if you use mb _ * () instead of the basic string functions.

Please note that PHP 7 also introduces Unicode Codepoint Escape Syntax which helps to handle UTF-8 strings.

+7


source


As I understand it, this means that the 64 bit version of PHP now has 64 bit integers. Previously, x64 Windows only had 32-bit integers.



+3


source







All Articles