Skip to content

promote error "Memcached constructor was not called" to exception #465

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

Merged
merged 1 commit into from
Nov 17, 2020

Conversation

remicollet
Copy link
Collaborator

For consistency with other PHP 8 extensions.

@sodabrew
Copy link
Collaborator

This seems fine. I'm not sure I understand why this would be PHP 8 only though, would it be reasonable to change across the board?

@remicollet
Copy link
Collaborator Author

I'm not sure I understand why this would be PHP 8

This change is a behavior change, which is usually not expected in stable releases.

Having error promoted to exception is a common behavior for all extensions from php-src (TypeError during zend_parse_parameters, ValueError, ...)

@sodabrew
Copy link
Collaborator

I would do the next release as 3.2.0, so I'm comfortable making this change a release note. The part I'm missing here is whether zend_throw_error and RETURN_THROW are available in PHP 7.x as well?

@remicollet
Copy link
Collaborator Author

remicollet commented Oct 23, 2020

The part I'm missing here is whether zend_throw_error

Yes

and RETURN_THROW are available in PHP 7.x as well?

No (but this is a simple "return")

On PHP 8 zend_parse_parameter also throw eception by default (exception is ZEND_PARSE_PARAMS_QUIET is used)

So for consistency, if you want to raise exceptions, and want to keep PHP 7 / 8 behavior the same, you also have to switch from

ZEND_PARSE_PARAMETERS_START(...

to

ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW...

P.S. this probably requires a rewritte of the test suite....

@sodabrew sodabrew merged commit 9a429d4 into php-memcached-dev:master Nov 17, 2020
@remicollet remicollet deleted the issue-excep branch November 17, 2020 11:16
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.

2 participants