-
Notifications
You must be signed in to change notification settings - Fork 7.9k
No longer allow block mode for declare(encoding) #9455
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
base: master
Are you sure you want to change the base?
Conversation
As discussed in php#9446, this isn't properly supported, and it is doubtful if it ever can be useful, let alone if it could be properly supported. Therefore, we disallow the confusing block mode in the first place.
--EXPECTF-- | ||
Fatal error: Encoding declaration pragma must not use block mode in %s on line %d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes no sense to test block mode thrice. Just change the test to not use block mode (or drop it if redundant).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, right! This was just to get CI green quickly. I'll update/fix this soonish.
@@ -6109,6 +6109,11 @@ static void zend_compile_declare(zend_ast *ast) /* {{{ */ | |||
zend_error_noreturn(E_COMPILE_ERROR, "Encoding declaration pragma must be " | |||
"the very first statement in the script"); | |||
} | |||
|
|||
if (ast->child[1] != NULL) { | |||
zend_error_noreturn(E_COMPILE_ERROR, "Encoding declaration pragma must not " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zend_error_noreturn(E_COMPILE_ERROR, "Encoding declaration pragma must not " | |
zend_error_noreturn(E_COMPILE_ERROR, "Encoding declaration must not " |
I know that pragma is used in the current wording, but the strict_type one does not use this word, so it might make sense to change the wording to be consistent
No objections from me. |
As discussed in #9446, this isn't properly supported, and it is
doubtful if it ever can be useful, let alone if it could be properly
supported. Therefore, we disallow the confusing block mode in the
first place.