Skip to content

THRIFT-5929: Fix build failure on PHP 8.5 due to removed zend_exception_get_default#3350

Open
pkvach wants to merge 1 commit intoapache:masterfrom
pkvach:fix-THRIFT-5929
Open

THRIFT-5929: Fix build failure on PHP 8.5 due to removed zend_exception_get_default#3350
pkvach wants to merge 1 commit intoapache:masterfrom
pkvach:fix-THRIFT-5929

Conversation

@pkvach
Copy link
Contributor

@pkvach pkvach commented Mar 19, 2026

Building the Thrift PHP extension fails with PHP 8.5 due to the removal of the zend_exception_get_default() function. The error is:

php_thrift_protocol.cpp:438:24: error: ‘zend_exception_get_default’ was not declared in this scope 

This function was removed in PHP 8.5 (see php-src commit link), and the recommended replacement is to use the global zend_ce_exception instead.

  • Did you create an Apache Jira ticket? (Request account here, not required for trivial changes)
  • If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
  • Did you squash your changes to a single commit? (not required, but preferred)
  • Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
  • If your change does not involve any code, include [skip ci] anywhere in the commit message to free up build resources.
@mergeable mergeable bot added php github_actions Pull requests that update GitHub Actions code labels Mar 19, 2026
@Jens-G
Copy link
Member

Jens-G commented Mar 21, 2026

There was 1 error: 1) Test\Thrift\Unit\Lib\Factory\TBinaryProtocolFactoryTest::testGetProtocol with data set "allTrue" (true, true) PHPUnit\Framework\Exception: PHP Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /home/runner/work/thrift/thrift/lib/php/test/Unit/Lib/Factory/TBinaryProtocolFactoryTest.php on line 49 Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /home/runner/work/thrift/thrift/lib/php/test/Unit/Lib/Factory/TBinaryProtocolFactoryTest.php on line 49 PHP Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /home/runner/work/thrift/thrift/lib/php/test/Unit/Lib/Factory/TBinaryProtocolFactoryTest.php on line 51 Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /home/runner/work/thrift/thrift/lib/php/test/Unit/Lib/Factory/TBinaryProtocolFactoryTest.php on line 51 PHP Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /home/runner/work/thrift/thrift/lib/php/test/Unit/Lib/Factory/TBinaryProtocolFactoryTest.php on line 53 Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /home/runner/work/thrift/thrift/lib/php/test/Unit/Lib/Factory/TBinaryProtocolFactoryTest.php on line 53 ERRORS! Tests: 9, Assertions: 24, Errors: 1. Error: Process completed with exit code 2. 
@pkvach
Copy link
Contributor Author

pkvach commented Mar 21, 2026

There was 1 error: 1) Test\Thrift\Unit\Lib\Factory\TBinaryProtocolFactoryTest::testGetProtocol with data set "allTrue" (true, true) PHPUnit\Framework\Exception: PHP Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /home/runner/work/thrift/thrift/lib/php/test/Unit/Lib/Factory/TBinaryProtocolFactoryTest.php on line 49 Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /home/runner/work/thrift/thrift/lib/php/test/Unit/Lib/Factory/TBinaryProtocolFactoryTest.php on line 49 PHP Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /home/runner/work/thrift/thrift/lib/php/test/Unit/Lib/Factory/TBinaryProtocolFactoryTest.php on line 51 Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /home/runner/work/thrift/thrift/lib/php/test/Unit/Lib/Factory/TBinaryProtocolFactoryTest.php on line 51 PHP Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /home/runner/work/thrift/thrift/lib/php/test/Unit/Lib/Factory/TBinaryProtocolFactoryTest.php on line 53 Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /home/runner/work/thrift/thrift/lib/php/test/Unit/Lib/Factory/TBinaryProtocolFactoryTest.php on line 53 ERRORS! Tests: 9, Assertions: 24, Errors: 1. Error: Process completed with exit code 2. 

Thanks for pointing that out!
I noticed the same issue and created a separate PR to fix the deprecation in tests: #3352

@Jens-G
Copy link
Member

Jens-G commented Mar 24, 2026

Could you rebase pls?

@pkvach
Copy link
Contributor Author

pkvach commented Mar 25, 2026

@Jens-G
I've rebased this PR on the latest master.
Please take another look. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code php

2 participants