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
PHP < 7.0: cannot use isset() on the result of an expression #1301
Comments
Here the RFC you're looking for: https://wiki.php.net/rfc/empty_isset_exprs |
@villfa Unfortunately that's not the right RFC. The RFC you referenced applies only to The change above is about |
My bad. I just notice the result of the vote excluded isset(). |
Source: WordPress/wordpress-develop#3555 (comment) Just ran into this one again. I still can't really find a relevant RFC, but I now think this is directly related to the addition of the ability to declare constant arrays in PHP. Doesn't look like either of those changes were handled via an RFC though, so finding the exact specs of the change will be sketchy. Even so, I think a sniff which would detect |
Given the following code samples:
Linting this on PHP < 7.0 results in a
Fatal error: Cannot use isset() on the result of an expression (you can use "null !== expression" instead)
error.Would be nice if we could detect this.
Patterns which do work cross-version:
I suspect this may be related to the Uniform Variable Syntax RFC, but haven't dug in to verify.
The text was updated successfully, but these errors were encountered: