Skip to content

Converted the zend_parse_parameters in xml.c to the fast API. #5561

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 1 commit into from
Closed

Converted the zend_parse_parameters in xml.c to the fast API. #5561

wants to merge 1 commit into from

Conversation

jensdenies
Copy link
Contributor

Hi,

This is my very first pull request for the PHP repository, so i apologize in advance if i did something wrong. The aim of this pull request is to convert some old zend_parse_parameters into their fast API variant.

The CONTRIBUTING.md states that "Failure conditions of zend_parse_parameters, ZEND_PARSE_PARAMETERS() and similar functions should not be tested.", so i deliberately didn't add tests.

Thanks.

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation should be tabs for C files and not spaces.

Moreover, I'm not sure it makes massive sense to change this.
I could understand it more if you need special functionality (like union types or extended FUNC) from the ZPP API which is not available in the old one.

} else {
ZEND_PARSE_PARAMETERS_START(0, 2)
Z_PARAM_OPTIONAL
Z_PARAM_STRING_EX(encoding_param, encoding_param_len, 1, 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be the Z_PARAM_STRING_OR_NULL version, moreover is there a reason for it to not use zend_strings instead of keeping the char* with a separate length.

@kocsismate
Copy link
Member

@jensdenies Thank you for contributing to PHP!

Unfortunately, fast ZPP is not always preferable to the "old" ZPP mechanism so mass changing all the parameter parsing in an extension most probably won't work well. :( For the background, please see #3041 (comment).

@jensdenies
Copy link
Contributor Author

@kocsismate Thanks for clarifying that! I'll close the PR then.
@Girgias Thanks for reviewing the code! I'm going to close the PR though because of @kocsismate's clarification.

@jensdenies jensdenies closed this May 12, 2020
@jensdenies jensdenies deleted the fast-zpp-xml branch May 12, 2020 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants