Skip to content

Improved zend string api (2) #1381

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

Closed
wants to merge 8 commits into from
Closed

Conversation

flaupretre
Copy link
Contributor

Follow-up to #1367 (prematurate close).

Add missing methods
Does not change anything to the generated code (thanks to compat macros) but cleaner.
Add compatibility macros to allow using previous names
Add compatibility macro.
Function should probably be moved for zend_operators.c to zend_string.c.
Also remove some macros we can define later when migrating the existing code to the new API.
@flaupretre
Copy link
Contributor Author

Yes, we could add a '_P' suffix to be consistent with Z_ADDREF_P. But the original function name is zend_string_addref() and we already have ZSTR_VAL(), ZSTR_LEN(), and ZSTR_HASH(). So, I prefer leaving the choice to Dmitry.

Dmitry suggested we changed every zend_string_xxx() function name to use 'ZSTR_' prefixes. So, even if zend_string_tolower() is not declared in zend_string.h, it is renamed. And the new name is not Z_STRTOLOWER, it is ZSTR_TOLOWER.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants