Skip to content

Conversation

kocsismate
Copy link
Member

Hopefully, I'm not missing any conceptual problem why the original RFC left this use-case out.

}
/* }}} */

static bool validate_constant_obj_argument(zend_object *obj)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clearly, this is just a placeholder :( I'm not sure what should be validated

if (Z_OBJ_HT_P(val)->cast_object(Z_OBJ_P(val), &val_free, IS_STRING) == SUCCESS) {
val = &val_free;
break;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the if above seems a bit problematic, since either BC or consistency is harmed, either it is removed, or left as-is.


if (!validate_constant_obj_argument(Z_OBJ_P(val))) {
RETURN_THROWS();
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure we need some custom code here, just like arrays do

@nikic
Copy link
Member

nikic commented Jul 14, 2021

See also #7149 and https://externals.io/message/114863. The discussion was positive, but I forgot to actually commit the change.

@kocsismate
Copy link
Member Author

See also #7149 and https://externals.io/message/114863. The discussion was positive, but I forgot to actually commit the change.

Thanks! In this case, I'm closing this PR, but I directly committed the stub change.

@kocsismate kocsismate closed this Jul 14, 2021
@kocsismate kocsismate deleted the new-define branch July 14, 2021 20:04
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