Add support for defining object constants via define()#7243
Closed
kocsismate wants to merge 1 commit into
Closed
Conversation
kocsismate
commented
Jul 14, 2021
| } | ||
| /* }}} */ | ||
|
|
||
| static bool validate_constant_obj_argument(zend_object *obj) |
Member
Author
There was a problem hiding this comment.
clearly, this is just a placeholder :( I'm not sure what should be validated
| @@ -520,11 +523,10 @@ ZEND_FUNCTION(define) | |||
| val = &val_free; | |||
| break; | |||
| } | |||
Member
Author
There was a problem hiding this comment.
the if above seems a bit problematic, since either BC or consistency is harmed, either it is removed, or left as-is.
kocsismate
commented
Jul 14, 2021
|
|
||
| if (!validate_constant_obj_argument(Z_OBJ_P(val))) { | ||
| RETURN_THROWS(); | ||
| } |
Member
Author
There was a problem hiding this comment.
I'm sure we need some custom code here, just like arrays do
Member
|
See also #7149 and https://externals.io/message/114863. The discussion was positive, but I forgot to actually commit the change. |
Member
Author
Thanks! In this case, I'm closing this PR, but I directly committed the stub change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hopefully, I'm not missing any conceptual problem why the original RFC left this use-case out.