Skip to content

Remove old zend_string compatibility aliases #19034

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DanielEScherzer
Copy link
Member

No description provided.

@DanielEScherzer
Copy link
Member Author

CC @iluuu1994, this was the motivation behind #19033

@iluuu1994
Copy link
Member

This may break some extensions, and IMO adds little value. It may be enough to just mark them with a deprecated comment. But I don't object if others agree with dropping.

@DanielEScherzer
Copy link
Member Author

These have been aliases since 4bd22cf, i.e. since PHP 7.0.0 - are there any extensions that still try to support PHP 5.6?

@iluuu1994
Copy link
Member

Extensions that still use the old macros will have to switch to the new ones, even though they do the same thing. It's not a huge problem, there aren't that many extensions, but it seems like unnecessary friction.

@DanielEScherzer
Copy link
Member Author

DanielEScherzer commented Jul 4, 2025

Did some github searches (code being in c, excluding forks) - in the results a bunch of hits seem like forks that aren't forked on GitHub, i.e. copies of php-src

If you exclude -path:Zend/ -path:zend_string.h, the hits drop

  • IS_INTERNED() 716 -> 352
  • STR_EMPTY_ALLOC() 764 -> 470
  • _STR_HEADER_SIZE 65 -> 15
  • STR_ALLOCA_ALLOC() 59 -> 7
  • STR_ALLOCA_INIT() 52 -> 1
  • STR_ALLOCA_FREE() 60 -> 7

@iluuu1994
Copy link
Member

@DanielEScherzer It may exclude too much, but -path:Zend/ may help.

@TimWolla
Copy link
Member

TimWolla commented Jul 4, 2025

I'm in favor of cleaning up this kind of legacy API, due to the DX improvements. As an example, it will make IDE autocompletion more useful.

Similarly to userland code, external extensions will also need to be checked for each new PHP version to make sure they integrate well (even if it builds, it doesn't mean that it's working well), updating to the latest API provided by PHP (especially when latest means PHP 7.0+) is a reasonable expectation.

In fact, I would be in favor of even more aggressive internal cleanups to improve maintainability and onboarding of new core developers. For this kind of cleanup we could provide official Coccinelle patches to allow external consumers to easily make the same changes.

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