Skip to content

Added support for PHP 8.1 (currently in RC1) to the C extension#8964

Merged
haberman merged 1 commit intoprotocolbuffers:3.18.xfrom
haberman:php-8.1
Sep 10, 2021
Merged

Added support for PHP 8.1 (currently in RC1) to the C extension#8964
haberman merged 1 commit intoprotocolbuffers:3.18.xfrom
haberman:php-8.1

Conversation

@haberman
Copy link
Member

@haberman haberman commented Sep 10, 2021

This switches to new interfaces for spl_ce_ArrayAccess and spl_ce_Countable (zend_ce_arrayaccess and zend_ce_countable, respectively). It polyfills zend_ce_countable for old versions of PHP.

There is also a small fix for the tests to fix the following error:

1) GeneratedClassTest::testMapFieldViaArray
Implicit conversion from float 6.1 to int loses precision

In PHP float array keys are truncated to integer, and this has nothing to do with protobuf.

The pure PHP library may require further fixes to support 8.1. I was not able to resolve those issues at this time.

Fixes: #8711

@haberman haberman merged commit 605ab95 into protocolbuffers:3.18.x Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants