Skip to content

Turn add_index_zval and add_next_index_zval into inline function #4250

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 2 commits into from

Conversation

twose
Copy link
Member

@twose twose commented Jun 11, 2019

we have to code like this for a long time:

(void) add_next_index_zval(foo, bar);

and I renamed idx to index (keep the same with the others)

@cmb69
Copy link
Member

cmb69 commented Jun 11, 2019

I think it would be strange to convert add_index_zval to a macro in PHP 7.4, and to convert it back to a function in PHP 8.

@twose
Copy link
Member Author

twose commented Jun 11, 2019

@cmb69 code like this?

#define add_index_zval(arg, index, value) \
	((void) (zend_hash_index_update(Z_ARRVAL_P(arg), index, value))

@cmb69
Copy link
Member

cmb69 commented Jun 11, 2019

@twose That would be one option. The other would be to target PHP-7.4 instead of master. The latter option would also solve microsoft/msphpsql#999.

@twose
Copy link
Member Author

twose commented Jun 11, 2019

but macro breaks the C++ namespace and make them different from other APIs
I think this will become a historical burden

@cmb69
Copy link
Member

cmb69 commented Jun 11, 2019

So indeed targeting PHP-7.4 might be better. @dstogov what do you think?

@dstogov
Copy link
Member

dstogov commented Jun 11, 2019

I don't see any problems.

@nikic
Copy link
Member

nikic commented Jun 14, 2019

I've applied the original version of this patch (macro -> inline function), as we need this on 7.4 as well. Dropping return value probably best left for master.

@mindaugasvcs
Copy link

Welcome to the dll hell!

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.

5 participants