diff --git a/ext/dom/document.c b/ext/dom/document.c index 2d6556c63bd..914b659f87e 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -1526,6 +1526,8 @@ _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type) /* If loading from memory, we need to set the base directory for the document but it is not apparent how to do that for schema's */ break; + default: + return; } xmlSchemaSetParserErrors(parser, @@ -1609,6 +1611,8 @@ _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int type) /* If loading from memory, we need to set the base directory for the document but it is not apparent how to do that for schema's */ break; + default: + return; } xmlRelaxNGSetParserErrors(parser, diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c index 1e4eefbe23c..689ae87994d 100644 --- a/ext/dom/namednodemap.c +++ b/ext/dom/namednodemap.c @@ -200,6 +200,8 @@ PHP_FUNCTION(dom_namednodemap_item) itemnode = curnode; } } + } else { + RETVAL_NULL(); } if (itemnode) { diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c index 5ecd2d763e7..56256987c78 100644 --- a/ext/dom/nodelist.c +++ b/ext/dom/nodelist.c @@ -134,6 +134,8 @@ PHP_FUNCTION(dom_nodelist_item) } } } + } else { + RETVAL_NULL(); } if (itemnode) {