-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Promote warnings to exceptions in ext/simplexml #6011
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
Conversation
ext/simplexml/simplexml.c
Outdated
@@ -400,7 +400,7 @@ static void change_node_zval(xmlNodePtr node, zval *value) | |||
} | |||
break; | |||
default: | |||
php_error_docref(NULL, E_WARNING, "It is not possible to assign complex types to nodes"); | |||
zend_type_error("It's not possible to assign a complex type to nodes, %s given", zend_zval_type_name(value)); |
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.
Error condition seems to be untested.
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.
Uh, I couldn't trigger this error case in the newly added test :/
5f9e78f
to
a80f41b
Compare
a80f41b
to
644dba8
Compare
@@ -411,7 +411,7 @@ static zval *sxe_prop_dim_write(zend_object *object, zval *member, zval *value, | |||
* and could also be E_PARSE, but we use this only during parsing | |||
* and this is during runtime. | |||
*/ | |||
zend_throw_error(NULL, "Cannot create unnamed attribute"); | |||
zend_throw_error(NULL, "Cannot append to an attribute list"); |
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.
I'd leave only the first line of the preceding comment.
|
* * &EG(error_zval), if an exception has been thrown. | ||
* * NULL, if acquiring a direct pointer is not possible. | ||
* In this case, the VM will fall back to using read_property and write_property. | ||
*/ |
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.
Thanks for the this explanation, it's really useful! Of course, I'm grateful for the fix, too :)
No description provided.