public function hasExsltSupport() {}
/**
- * @param string|array $restrict
+ * @param string|array|null $restrict
* @return void
*/
- public function registerPHPFunctions($restrict = UNKNOWN) {}
+ public function registerPHPFunctions($restrict = null) {}
/** @return bool */
public function setProfiling(?string $filename) {}
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_registerPHPFunctions, 0, 0, 0)
- ZEND_ARG_INFO(0, restrict)
+ ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, restrict, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_setProfiling, 0, 0, 1)
{
zval *id = ZEND_THIS;
xsl_object *intern;
- zval *array_value, *entry, new_string;
- zend_string *name;
+ zval *entry, new_string;
+ zend_string *restrict_str = NULL;
+ HashTable *restrict_ht = NULL;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "a", &array_value) == SUCCESS) {
- intern = Z_XSL_P(id);
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(restrict_str, restrict_ht)
+ ZEND_PARSE_PARAMETERS_END();
+
+ intern = Z_XSL_P(id);
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(array_value), entry) {
+ if (restrict_ht) {
+ ZEND_HASH_FOREACH_VAL(restrict_ht, entry) {
zend_string *str = zval_try_get_string(entry);
if (UNEXPECTED(!str)) {
return;
} ZEND_HASH_FOREACH_END();
intern->registerPhpFunctions = 2;
- } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "S", &name) == SUCCESS) {
- intern = Z_XSL_P(id);
-
- ZVAL_LONG(&new_string,1);
- zend_hash_update(intern->registered_phpfunctions, name, &new_string);
+ } else if (restrict_str) {
+ ZVAL_LONG(&new_string, 1);
+ zend_hash_update(intern->registered_phpfunctions, restrict_str, &new_string);
intern->registerPhpFunctions = 2;
-
- } else if (zend_parse_parameters_none() == SUCCESS) {
- intern = Z_XSL_P(id);
+ } else {
intern->registerPhpFunctions = 1;
}
}