/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: ce4644d8cb6fdf0f3b9f5d1cbac773b406884ad9 */
+ * Stub hash: a9c30985948768261ea275fdbde598cf9119029e */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_dom_import_simplexml, 0, 1, DOMElement, 1)
ZEND_ARG_TYPE_INFO(0, node, IS_OBJECT, 0)
#if defined(LIBXML_XPATH_ENABLED)
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DOMXPath_registerPhpFunctions, 0, 0, 0)
- ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, restrict, "null")
+ ZEND_ARG_TYPE_MASK(0, restrict, MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_NULL, "null")
ZEND_END_ARG_INFO()
#endif
PHP_METHOD(DOMXPath, registerPhpFunctions)
{
zval *id = ZEND_THIS;
- dom_xpath_object *intern;
- zval *array_value, *entry, new_string;
- zend_string *name;
-
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "a", &array_value) == SUCCESS) {
- intern = Z_XPATHOBJ_P(id);
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(array_value), entry) {
+ dom_xpath_object *intern = Z_XPATHOBJ_P(id);
+ zval *entry, new_string;
+ zend_string *name = NULL;
+ HashTable *ht = NULL;
+
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(name, ht)
+ ZEND_PARSE_PARAMETERS_END();
+
+ if (ht) {
+ ZEND_HASH_FOREACH_VAL(ht, entry) {
zend_string *str = zval_get_string(entry);
- ZVAL_LONG(&new_string,1);
+ ZVAL_LONG(&new_string, 1);
zend_hash_update(intern->registered_phpfunctions, str, &new_string);
zend_string_release_ex(str, 0);
} ZEND_HASH_FOREACH_END();
intern->registerPhpFunctions = 2;
RETURN_TRUE;
-
- } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "S", &name) == SUCCESS) {
- intern = Z_XPATHOBJ_P(id);
-
+ } else if (name) {
ZVAL_LONG(&new_string, 1);
zend_hash_update(intern->registered_phpfunctions, name, &new_string);
intern->registerPhpFunctions = 2;
} else {
- intern = Z_XPATHOBJ_P(id);
intern->registerPhpFunctions = 1;
}