Skip to content
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

Nullable argument var is defined incorrectly #2245

Closed
Jeckerson opened this issue May 12, 2021 · 0 comments · Fixed by #2246
Closed

Nullable argument var is defined incorrectly #2245

Jeckerson opened this issue May 12, 2021 · 0 comments · Fixed by #2246
Assignees
Labels
Milestone

Comments

@Jeckerson
Copy link
Member

Jeckerson commented May 12, 2021

This code:

public function test(var params = null)
{

}

generates:

#if PHP_VERSION_ID >= 80000
	bool is_null_true = 1;
	ZEND_PARSE_PARAMETERS_START(0, 1)
		Z_PARAM_OPTIONAL
		Z_PARAM_ZVAL(params)
	ZEND_PARSE_PARAMETERS_END();
#endif

And need to be:

Z_PARAM_ZVAL_OR_NULL()
@Jeckerson Jeckerson added the bug label May 12, 2021
@Jeckerson Jeckerson self-assigned this May 12, 2021
@Jeckerson Jeckerson added this to the 0.13.6 milestone May 12, 2021
Jeckerson added a commit that referenced this issue May 12, 2021
AlexNDRmac added a commit that referenced this issue May 12, 2021
#2245 - Add `Z_PARAM_ZVAL_OR_NULL` for default value
@Jeckerson Jeckerson linked a pull request May 12, 2021 that will close this issue
3 tasks
@Jeckerson Jeckerson modified the milestones: 0.13.6, 0.14.x Sep 9, 2021
@Jeckerson Jeckerson modified the milestones: 0.14.x, 0.14.0 Oct 3, 2021
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 a pull request may close this issue.

1 participant