sveneld opened a new pull request, #3445:
URL: https://github.com/apache/thrift/pull/3445

   ## Summary
   
   
[`mbstring.func_overload`](https://www.php.net/manual/en/mbstring.overload.php) 
was deprecated in PHP 7.2 and **removed in PHP 8.0**. Since 
[THRIFT-5956](https://issues.apache.org/jira/browse/THRIFT-5956) raised the 
project's minimum PHP version to 8.1, the `TStringFunc` abstraction that 
guarded against this ini setting has been functionally unreachable on every 
supported runtime — `ini_get('mbstring.func_overload')` always returns `false`. 
This PR removes the dead workaround.
   
   This is **not a behavior change** on PHP 8.1+: 
`TStringFuncFactory::create()->strlen($x)` and native `strlen($x)` already 
return the same byte count, which is what Thrift's binary protocols require. 
The Thrift code generator does not emit any `TStringFunc*` references, so 
generated user code is unaffected.
   
   ## What changed
   
   - Deleted `Thrift\Factory\TStringFuncFactory`, `Thrift\StringFunc\{Core, 
Mbstring, TStringFunc}`, and the legacy `lib/php/src/TStringUtils.php`.
   - Replaced 30+ `TStringFuncFactory::create()->strlen/substr` call sites in 
`lib/Transport/*` and `lib/Protocol/*` with native `strlen()` / `substr()`.
   - Removed the corresponding unit tests (`TStringFuncFactoryTest`, 
`CoreTest`, `MbStringTest`) and the obsolete `mbstring.func_overload=0` ini 
override in `src/ext/thrift_protocol/run-tests.php`.
   - No `mb_*` calls remain anywhere in `lib/php`, `test/php`, the tutorial, or 
the C extension — so `mbstring` is dropped from `build.yml`, `sca.yml`, and the 
`focal`/`jammy`/`noble` Dockerfiles.
   - Updated `lib/php/Makefile.am` to drop the `phpstringfuncdir` block and the 
`src/TStringUtils.php` distribution entry; `src/Thrift.php` no longer includes 
the deleted file.
   
   Diff: 26 files changed, 44 insertions(+), 870 deletions(-).
   
   ## Test plan
   
   - [ ] CI lib-php matrix passes on PHP 8.1, 8.2, 8.3, 8.4, 8.5.
   - [ ] Cross-test job on PHP 8.3 passes.
   - [ ] phpstan analysis passes.
   - [ ] phpcs (coding standards) passes.
   - [ ] Sanity grep — no leftover `TStringFunc*`, `TStringUtils`, or `mb_*` 
references in active source.
   
   JIRA: https://issues.apache.org/jira/browse/THRIFT-5759


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to