Hello,
I discovered today that the DOMNode::getAttribute() function (which is
undocumented on the php site) returns an empty string if the requested
attribute doesn't exist in the node.
>From the source:
if (value == NULL) {
RETURN_EMPTY_STRING();
} else {
RETVAL_STRING((char *)value, 1);
xmlFree(value);
}
Seems to me that it should return NULL. (That's what libxml does, apparently.)
Does anyone know of a particular reason it returns an empty string instead?
Does anyone know of a particular reason it is not documented?
(I'd be happy to document and provide the ridiculously simple patch of
returning NULL...)
Thanks,
-Matt
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php