#define Z_PARAM_PATH_STR(dest) \
Z_PARAM_PATH_STR_EX(dest, 0, 0)
+#define Z_PARAM_PATH_STR_OR_NULL(dest) \
+ Z_PARAM_PATH_STR_EX(dest, 1, 0)
+
/* old "r" */
#define Z_PARAM_RESOURCE_EX2(dest, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
{
/**
* @param object $object
- * @return mixed
*/
- public function offsetGet($object) {}
+ public function offsetGet($object): mixed {}
- /**
- * @param object $object
- * @param mixed $value
- */
- public function offsetSet($object, $value): void {}
+ /** @param object $object */
+ public function offsetSet($object, mixed $value): void {}
/** @param object $object */
public function offsetExists($object): bool {}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 8a90ffe614346c65d312bc5061fd304056b5640a */
+ * Stub hash: 0569bc7e10a1ec15a3a9eec481da27b647eb1d1d */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_WeakReference___construct, 0, 0, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_WeakReference_get, 0, 0, IS_OBJECT, 1)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_class_WeakMap_offsetGet, 0, 0, 1)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_WeakMap_offsetGet, 0, 1, IS_MIXED, 0)
ZEND_ARG_INFO(0, object)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_WeakMap_offsetSet, 0, 2, IS_VOID, 0)
ZEND_ARG_INFO(0, object)
- ZEND_ARG_INFO(0, value)
+ ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_WeakMap_offsetExists, 0, 1, _IS_BOOL, 0)
PHP_METHOD(com, __construct)
{
zval *object = getThis();
- zval *server_params = NULL;
+ zend_string *server_name = NULL;
+ HashTable *server_params = NULL;
php_com_dotnet_object *obj;
char *module_name, *typelib_name = NULL;
size_t module_name_len = 0, typelib_name_len = 0;
- zend_string *server_name = NULL, *user_name = NULL, *password = NULL, *domain_name = NULL;
+ zend_string *user_name = NULL, *password = NULL, *domain_name = NULL;
OLECHAR *moniker;
CLSID clsid;
CLSCTX ctx = CLSCTX_SERVER;
zend_long cp = GetACP();
const struct php_win32_cp *cp_it;
- if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS(), "s|S!ls",
- &module_name, &module_name_len, &server_name,
- &cp, &typelib_name, &typelib_name_len) &&
- FAILURE == zend_parse_parameters(
- ZEND_NUM_ARGS(), "sa|ls",
- &module_name, &module_name_len, &server_params, &cp,
- &typelib_name, &typelib_name_len)) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_STRING(module_name, module_name_len)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(server_name, server_params)
+ Z_PARAM_LONG(cp)
+ Z_PARAM_STRING(typelib_name, typelib_name_len)
+ ZEND_PARSE_PARAMETERS_END();
php_com_initialize();
obj = CDNO_FETCH(object);
/* decode the data from the array */
- if (NULL != (tmp = zend_hash_str_find(Z_ARRVAL_P(server_params),
+ if (NULL != (tmp = zend_hash_str_find(server_params,
"Server", sizeof("Server")-1))) {
server_name = zval_get_string(tmp);
ctx = CLSCTX_REMOTE_SERVER;
}
- if (NULL != (tmp = zend_hash_str_find(Z_ARRVAL_P(server_params),
+ if (NULL != (tmp = zend_hash_str_find(server_params,
"Username", sizeof("Username")-1))) {
user_name = zval_get_string(tmp);
}
- if (NULL != (tmp = zend_hash_str_find(Z_ARRVAL_P(server_params),
+ if (NULL != (tmp = zend_hash_str_find(server_params,
"Password", sizeof("Password")-1))) {
password = zval_get_string(tmp);
}
- if (NULL != (tmp = zend_hash_str_find(Z_ARRVAL_P(server_params),
+ if (NULL != (tmp = zend_hash_str_find(server_params,
"Domain", sizeof("Domain")-1))) {
domain_name = zval_get_string(tmp);
}
- if (NULL != (tmp = zend_hash_str_find(Z_ARRVAL_P(server_params),
+ if (NULL != (tmp = zend_hash_str_find(server_params,
"Flags", sizeof("Flags")-1))) {
ctx = (CLSCTX)zval_get_long(tmp);
}
/* {{{ Connect events from a COM object to a PHP object */
PHP_FUNCTION(com_event_sink)
{
- zval *object, *sinkobject, *sink=NULL;
+ zval *object, *sinkobject;
+ zend_string *sink_str = NULL;
+ HashTable *sink_ht = NULL;
char *dispname = NULL, *typelibname = NULL;
php_com_dotnet_object *obj;
ITypeInfo *typeinfo = NULL;
- RETVAL_FALSE;
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_OBJECT_OF_CLASS(object, php_com_variant_class_entry)
+ Z_PARAM_OBJECT(sinkobject)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(sink_str, sink_ht)
+ ZEND_PARSE_PARAMETERS_END();
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Oo|z/",
- &object, php_com_variant_class_entry, &sinkobject, &sink)) {
- RETURN_THROWS();
- }
+ RETVAL_FALSE;
php_com_initialize();
obj = CDNO_FETCH(object);
- if (sink && Z_TYPE_P(sink) == IS_ARRAY) {
+ if (sink_ht) {
/* 0 => typelibname, 1 => dispname */
zval *tmp;
- if ((tmp = zend_hash_index_find(Z_ARRVAL_P(sink), 0)) != NULL && Z_TYPE_P(tmp) == IS_STRING)
+ if ((tmp = zend_hash_index_find(sink_ht, 0)) != NULL && Z_TYPE_P(tmp) == IS_STRING)
typelibname = Z_STRVAL_P(tmp);
- if ((tmp = zend_hash_index_find(Z_ARRVAL_P(sink), 1)) != NULL && Z_TYPE_P(tmp) == IS_STRING)
+ if ((tmp = zend_hash_index_find(sink_ht, 1)) != NULL && Z_TYPE_P(tmp) == IS_STRING)
dispname = Z_STRVAL_P(tmp);
- } else if (sink != NULL) {
- if (!try_convert_to_string(sink)) {
- RETURN_THROWS();
- }
- dispname = Z_STRVAL_P(sink);
+ } else if (sink_str) {
+ dispname = ZSTR_VAL(sink_str);
}
typeinfo = php_com_locate_typeinfo(typelibname, obj, dispname, 1);
function com_create_guid(): string|false {}
-/** @param array|string|null $sinkinterface */
-function com_event_sink(variant $comobject, object $sinkobject, $sinkinterface = UNKNOWN): bool {}
+function com_event_sink(variant $comobject, object $sinkobject, array|string|null $sinkinterface = null): bool {}
/** @param com|dotnet|variant|string $comobject */
function com_print_typeinfo($comobject, ?string $dispinterface = null, bool $wantsink = false): bool {}
class com
{
- /** @param string|array|null $server_name */
- public function __construct(string $module_name, $server_name = UNKNOWN, int $codepage = CP_ACP, string $typelib = "") {}
+ public function __construct(string $module_name, array|string|null $server_name = null, int $codepage = CP_ACP, string $typelib = "") {}
}
#if HAVE_MSCOREE_H
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 48167f9ee38966beaf550cd0a7b07d873575b48e */
+ * Stub hash: f78e9db58131f9d67021eaea4c3d4be75cafe2ac */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_variant_set, 0, 2, IS_VOID, 0)
ZEND_ARG_OBJ_INFO(0, variant, variant, 0)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_com_event_sink, 0, 2, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, comobject, variant, 0)
ZEND_ARG_TYPE_INFO(0, sinkobject, IS_OBJECT, 0)
- ZEND_ARG_INFO(0, sinkinterface)
+ ZEND_ARG_TYPE_MASK(0, sinkinterface, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_com_print_typeinfo, 0, 1, _IS_BOOL, 0)
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_com___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, module_name, IS_STRING, 0)
- ZEND_ARG_INFO(0, server_name)
+ ZEND_ARG_TYPE_MASK(0, server_name, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, codepage, IS_LONG, 0, "CP_ACP")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, typelib, IS_STRING, 0, "\"\"")
ZEND_END_ARG_INFO()
/** @generate-function-entries */
-/** @param string|int $text */
function ctype_alnum(mixed $text): bool {}
-/** @param string|int $text */
function ctype_alpha(mixed $text): bool {}
-/** @param string|int $text */
function ctype_cntrl(mixed $text): bool {}
-/** @param string|int $text */
function ctype_digit(mixed $text): bool {}
-/** @param string|int $text */
function ctype_lower(mixed $text): bool {}
-/** @param string|int $text */
function ctype_graph(mixed $text): bool {}
-/** @param string|int $text */
function ctype_print(mixed $text): bool {}
-/** @param string|int $text */
function ctype_punct(mixed $text): bool {}
-/** @param string|int $text */
function ctype_space(mixed $text): bool {}
-/** @param string|int $text */
function ctype_upper(mixed $text): bool {}
-/** @param string|int $text */
function ctype_xdigit(mixed $text): bool {}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 5263184b90f82d53c6da4388c79b76a8c17977e9 */
+ * Stub hash: aa287af25fe33a05d15d85b92b0edcfae00284a2 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ctype_alnum, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, text, IS_MIXED, 0)
ZEND_METHOD(FFI, new) /* {{{ */
{
zend_string *type_def = NULL;
- zval *ztype = NULL;
+ zend_object *type_obj = NULL;
zend_ffi_type *type, *type_ptr;
zend_ffi_cdata *cdata;
void *ptr;
ZEND_FFI_VALIDATE_API_RESTRICTION();
ZEND_PARSE_PARAMETERS_START(1, 3)
- if (Z_TYPE_P(EX_VAR_NUM(0)) == IS_STRING) {
- Z_PARAM_STR(type_def)
- } else {
- Z_PARAM_OBJECT_OF_CLASS(ztype, zend_ffi_ctype_ce)
- }
+ Z_PARAM_STR_OR_OBJ_OF_CLASS(type_def, type_obj, zend_ffi_ctype_ce)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(owned)
Z_PARAM_BOOL(persistent)
type_ptr = dcl.type;
} else {
- zend_ffi_ctype *ctype = (zend_ffi_ctype*)Z_OBJ_P(ztype);
+ zend_ffi_ctype *ctype = (zend_ffi_ctype*) type_obj;
type_ptr = type = ctype->type;
if (ZEND_FFI_TYPE_IS_OWNED(type)) {
public static function scope(string $scope_name): ?FFI {}
- /** @param FFI\CType|string $type */
- public static function new($type, bool $owned = true, bool $persistent = false): ?FFI\CData {}
+ public static function new(FFI\CType|string $type, bool $owned = true, bool $persistent = false): ?FFI\CData {}
/** @prefer-ref $ptr */
public static function free(FFI\CData $ptr): void {}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: a486305cd865e2798f7d9916760a3ec3c6f114b0 */
+ * Stub hash: c5ad08a2c62988e2b50468c1c5b941b5c28f23b5 */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_cdef, 0, 0, FFI, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, code, IS_STRING, 0, "\"\"")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_new, 0, 1, FFI\\CData, 1)
- ZEND_ARG_INFO(0, type)
+ ZEND_ARG_OBJ_TYPE_MASK(0, type, FFI\\CType, MAY_BE_STRING, NULL)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, owned, _IS_BOOL, 0, "true")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, persistent, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()
public function clear(?int $field = null) {}
/**
- * @param DateTime|string $dateTime
* @return IntlCalendar|null
* @alias intlcal_from_date_time
*/
- public static function fromDateTime($dateTime, ?string $locale = null) {}
+ public static function fromDateTime(DateTime|string $dateTime, ?string $locale = null) {}
/**
* @return int
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 3facb6bdce18efae3d6b9594d1fcddfb220dd54d */
+ * Stub hash: 0ac7a1d4e011518fc956fb05624b45b061fa9710 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlCalendar___construct, 0, 0, 0)
ZEND_END_ARG_INFO()
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlCalendar_fromDateTime, 0, 0, 1)
- ZEND_ARG_INFO(0, dateTime)
+ ZEND_ARG_OBJ_TYPE_MASK(0, dateTime, DateTime, MAY_BE_STRING, NULL)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, locale, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()
U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
{
- zval *zv_arg,
- zv_tmp,
- *zv_datetime = NULL,
- zv_timestamp;
+ zend_object *date_obj;
+ zend_string *date_str;
+ zval zv_tmp, zv_arg, zv_timestamp;
php_date_obj *datetime;
- char *locale_str = NULL;
+ char *locale_str = NULL;
size_t locale_str_len;
TimeZone *timeZone;
- UErrorCode status = U_ZERO_ERROR;
+ UErrorCode status = U_ZERO_ERROR;
Calendar *cal;
intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|s!",
- &zv_arg, &locale_str, &locale_str_len) == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR_OR_OBJ_OF_CLASS(date_str, date_obj, php_date_get_date_ce())
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STRING_OR_NULL(locale_str, locale_str_len)
+ ZEND_PARSE_PARAMETERS_END();
- if (!(Z_TYPE_P(zv_arg) == IS_OBJECT && instanceof_function(
- Z_OBJCE_P(zv_arg), php_date_get_date_ce()))) {
+ if (date_str) {
object_init_ex(&zv_tmp, php_date_get_date_ce());
- zend_call_known_instance_method_with_1_params(
- Z_OBJCE(zv_tmp)->constructor, Z_OBJ(zv_tmp), NULL, zv_arg);
- zv_datetime = &zv_tmp;
+ ZVAL_STR(&zv_arg, date_str);
+ zend_call_known_instance_method_with_1_params(Z_OBJCE(zv_tmp)->constructor, Z_OBJ(zv_tmp), NULL, &zv_arg);
+ date_obj = Z_OBJ(zv_tmp);
if (EG(exception)) {
zend_object_store_ctor_failed(Z_OBJ(zv_tmp));
goto error;
}
- } else {
- zv_datetime = zv_arg;
}
- datetime = Z_PHPDATE_P(zv_datetime);
+ datetime = php_date_obj_from_obj(date_obj);
if (!datetime->time) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_from_date_time: DateTime object is unconstructed",
goto error;
}
- zend_call_method_with_0_params(Z_OBJ_P(zv_datetime), php_date_get_date_ce(), NULL, "gettimestamp", &zv_timestamp);
+ zend_call_method_with_0_params(date_obj, php_date_get_date_ce(), NULL, "gettimestamp", &zv_timestamp);
if (Z_TYPE(zv_timestamp) != IS_LONG) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_from_date_time: bad DateTime; call to "
calendar_object_create(return_value, cal);
error:
- if (zv_datetime && zv_datetime != zv_arg) {
- zval_ptr_dtor(zv_datetime);
+ if (date_str) {
+ OBJ_RELEASE(date_obj);
}
}
public function isLenient() {}
/**
- * @param array|int $value
+ * @param object|array|string|int|float $value
* @return string|false
* @alias datefmt_format
*/
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: e98080c0b9107da6a2bf3ce99929554eb9a3c70e */
+ * Stub hash: 1b018a6b473db965a89c4ce9ebce3133d8d304db */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter___construct, 0, 0, 3)
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 1)
RETURN_FALSE; \
}
+/* Check status in object, if error goto a label */
+#define INTL_METHOD_CHECK_STATUS_OR_GOTO(obj, msg, label) \
+ intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) ); \
+ if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \
+ { \
+ intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 ); \
+ RETVAL_FALSE; \
+ goto label; \
+ }
+
/* Check status in object, if error return null */
#define INTL_METHOD_CHECK_STATUS_OR_NULL(obj, msg) \
intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) ); \
function intlcal_set_skipped_wall_time_option(IntlCalendar $calendar, int $wallTimeOption): bool {}
-/** @param DateTime|string $dateTime */
-function intlcal_from_date_time($dateTime, ?string $locale = null): ?IntlCalendar {}
+function intlcal_from_date_time(DateTime|string $dateTime, ?string $locale = null): ?IntlCalendar {}
function intlcal_to_date_time(IntlCalendar $calendar): DateTime|false {}
function datefmt_is_lenient(IntlDateFormatter $df): bool {}
-/** @param mixed $value */
+/** @param object|array|string|int|float $value */
function datefmt_format(IntlDateFormatter $df, $value): string|false {}
/**
/** @param int|float $value */
function numfmt_set_attribute(NumberFormatter $fmt, int $attr, $value): bool {}
-function numfmt_get_attribute(NumberFormatter $fmt, int $attr): int|double|false {}
+function numfmt_get_attribute(NumberFormatter $fmt, int $attr): int|float|false {}
function numfmt_set_text_attribute(NumberFormatter $fmt, int $attr, string $value): bool {}
function intltz_create_default(): IntlTimeZone {}
/**
- * @param IntlTimeZone|string|int|double|null $countryOrRawOffset
+ * @param IntlTimeZone|string|int|float|null $countryOrRawOffset
* @return IntlIterator|false
*/
function intltz_create_enumeration($countryOrRawOffset = null) {}
function transliterator_create_inverse(Transliterator $orig_trans): ?Transliterator {}
-/** @param Transliterator|string $transliterator */
-function transliterator_transliterate($transliterator, string $subject, int $start = 0, int $end = -1): string|false {}
+function transliterator_transliterate(Transliterator|string $transliterator, string $subject, int $start = 0, int $end = -1): string|false {}
function transliterator_get_error_code(Transliterator $trans): int|false {}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 57c63e06f2c6cf6c58a63081f19fe3e6d6901e88 */
+ * Stub hash: 9284fbafde8c7430a30a8fff5537bf9e6d9c6125 */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_create_instance, 0, 0, IntlCalendar, 1)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timeZone, "null")
#define arginfo_intlcal_set_skipped_wall_time_option arginfo_intlcal_set_repeated_wall_time_option
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_from_date_time, 0, 1, IntlCalendar, 1)
- ZEND_ARG_INFO(0, dateTime)
+ ZEND_ARG_OBJ_TYPE_MASK(0, dateTime, DateTime, MAY_BE_STRING, NULL)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, locale, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_numfmt_get_attribute, 0, 2, double, MAY_BE_LONG|MAY_BE_FALSE)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_numfmt_get_attribute, 0, 2, MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_FALSE)
ZEND_ARG_OBJ_INFO(0, fmt, NumberFormatter, 0)
ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_transliterator_transliterate, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
- ZEND_ARG_INFO(0, transliterator)
+ ZEND_ARG_OBJ_TYPE_MASK(0, transliterator, Transliterator, MAY_BE_STRING, NULL)
ZEND_ARG_TYPE_INFO(0, subject, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, start, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, end, IS_LONG, 0, "-1")
public static function createDefault() {}
/**
- * @param IntlTimeZone|string|int|double|null $countryOrRawOffset
+ * @param IntlTimeZone|string|int|float|null $countryOrRawOffset
* @return IntlIterator|false
* @alias intltz_create_enumeration
*/
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 94e3c8228a0625a2c5825b0747fb1e5e08808b50 */
+ * Stub hash: 69c4f052e9c75c4adb5b1b7056db981b2b26a22f */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlTimeZone___construct, 0, 0, 0)
ZEND_END_ARG_INFO()
TRANSLITERATOR_METHOD_INIT_VARS;
object = getThis();
+
ZVAL_UNDEF(&tmp_object);
- if( object == NULL )
- {
+ if (object == NULL) {
/* in non-OOP version, accept both a transliterator and a string */
- zval *arg1;
- if( zend_parse_parameters( ZEND_NUM_ARGS(), "zs|ll",
- &arg1, &str, &str_len, &start, &limit ) == FAILURE )
- {
- RETURN_THROWS();
- }
-
- if( Z_TYPE_P( arg1 ) == IS_OBJECT &&
- instanceof_function( Z_OBJCE_P( arg1 ), Transliterator_ce_ptr ) )
- {
- object = arg1;
- }
- else
- { /* not a transliterator object as first argument */
+ zend_string *arg1_str;
+ zend_object *arg1_obj;
+
+ ZEND_PARSE_PARAMETERS_START(2, 4)
+ Z_PARAM_STR_OR_OBJ_OF_CLASS(arg1_str, arg1_obj, Transliterator_ce_ptr)
+ Z_PARAM_STRING(str, str_len)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(start)
+ Z_PARAM_LONG(limit)
+ ZEND_PARSE_PARAMETERS_END();
+
+ if (arg1_str) { /* not a transliterator object as first argument */
int res;
- if( !try_convert_to_string( arg1 ) ) {
- RETURN_THROWS();
- }
object = &tmp_object;
- res = create_transliterator( Z_STRVAL_P( arg1 ), Z_STRLEN_P( arg1 ),
- TRANSLITERATOR_FORWARD, object );
+ res = create_transliterator(ZSTR_VAL(arg1_str), ZSTR_LEN(arg1_str), TRANSLITERATOR_FORWARD, object);
if( res == FAILURE )
{
zend_string *message = intl_error_get_message( NULL );
php_error_docref(NULL, E_WARNING, "Could not create "
- "transliterator with ID \"%s\" (%s)", Z_STRVAL_P( arg1 ), ZSTR_VAL(message) );
+ "transliterator with ID \"%s\" (%s)", ZSTR_VAL(arg1_str), ZSTR_VAL(message) );
zend_string_free( message );
ZVAL_UNDEF(&tmp_object);
/* don't set U_ILLEGAL_ARGUMENT_ERROR to allow fetching of inner error */
goto cleanup;
}
+ } else {
+ ZVAL_OBJ_COPY(&tmp_object, arg1_obj);
+ object = &tmp_object;
}
- }
- else if( zend_parse_parameters( ZEND_NUM_ARGS(), "s|ll",
- &str, &str_len, &start, &limit ) == FAILURE )
- {
+ } else if(zend_parse_parameters( ZEND_NUM_ARGS(), "s|ll", &str, &str_len, &start, &limit) == FAILURE) {
RETURN_THROWS();
}
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
"transliterator_transliterate: \"end\" argument should be "
"either non-negative or -1", 0 );
- RETURN_FALSE;
+ RETVAL_FALSE;
+ goto cleanup_object;
}
if( start < 0 || ((limit != -1 ) && (start > limit )) )
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
"transliterator_transliterate: \"start\" argument should be "
"non-negative and not bigger than \"end\" (if defined)", 0 );
- RETURN_FALSE;
+ RETVAL_FALSE;
+ goto cleanup_object;
}
/* end argument parsing/validation */
TRANSLITERATOR_METHOD_FETCH_OBJECT;
- intl_convert_utf8_to_utf16( &ustr, &ustr_len, str, str_len,
- TRANSLITERATOR_ERROR_CODE_P( to ) );
- INTL_METHOD_CHECK_STATUS( to, "String conversion of string to UTF-16 failed" );
+ intl_convert_utf8_to_utf16(&ustr, &ustr_len, str, str_len, TRANSLITERATOR_ERROR_CODE_P(to));
+ INTL_METHOD_CHECK_STATUS_OR_GOTO(to, "String conversion of string to UTF-16 failed", cleanup_object);
/* we've started allocating resources, goto from now on */
RETVAL_FALSE;
}
+cleanup_object:
zval_ptr_dtor( &tmp_object );
}
/* }}} */
/** @generate-function-entries */
-/**
- * @param resource $statement_resource
- * @param mixed $variable
- */
-function oci_define_by_name($statement_resource, string $column_name, &$variable, int $type = 0): bool {}
+/** @param resource $statement_resource */
+function oci_define_by_name($statement_resource, string $column_name, mixed &$variable, int $type = 0): bool {}
/**
* @param resource $statement_resource
- * @param mixed $variable
* @alias oci_define_by_name
* @deprecated
*/
-function ocidefinebyname($statement_resource, string $column_name, &$variable, int $type = 0): bool {}
+function ocidefinebyname($statement_resource, string $column_name, mixed &$variable, int $type = 0): bool {}
-/**
- * @param resource $statement_resource
- * @param mixed $variable
- */
-function oci_bind_by_name($statement_resource, string $column_name, &$variable, int $maximum_length = -1, int $type = 0): bool {}
+/** @param resource $statement_resource */
+function oci_bind_by_name($statement_resource, string $column_name, mixed &$variable, int $maximum_length = -1, int $type = 0): bool {}
/**
* @param resource $statement_resource
- * @param mixed $variable
* @alias oci_bind_by_name
* @deprecated
*/
-function ocibindbyname($statement_resource, string $column_name, &$variable, int $maximum_length = -1, int $type = 0): bool {}
+function ocibindbyname($statement_resource, string $column_name, mixed &$variable, int $maximum_length = -1, int $type = 0): bool {}
-/**
- * @param resource $statement_resource
- * @param mixed $variable
- */
-function oci_bind_array_by_name($statement_resource, string $column_name, &$variable, int $maximum_array_length, int $maximum_item_length = -1, int $type = SQLT_AFC): bool {}
+/** @param resource $statement_resource */
+function oci_bind_array_by_name($statement_resource, string $column_name, mixed &$variable, int $maximum_array_length, int $maximum_item_length = -1, int $type = SQLT_AFC): bool {}
function oci_free_descriptor(OCILob $lob_descriptor): bool {}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 1c1a73f6a4de5fa2ca9595125822d65bc4f5fc55 */
+ * Stub hash: a5a245b354b48a56c274c8f74c974d92ec430853 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_define_by_name, 0, 3, _IS_BOOL, 0)
ZEND_ARG_INFO(0, statement_resource)
ZEND_ARG_TYPE_INFO(0, column_name, IS_STRING, 0)
- ZEND_ARG_INFO(1, variable)
+ ZEND_ARG_TYPE_INFO(1, variable, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_bind_by_name, 0, 3, _IS_BOOL, 0)
ZEND_ARG_INFO(0, statement_resource)
ZEND_ARG_TYPE_INFO(0, column_name, IS_STRING, 0)
- ZEND_ARG_INFO(1, variable)
+ ZEND_ARG_TYPE_INFO(1, variable, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, maximum_length, IS_LONG, 0, "-1")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_bind_array_by_name, 0, 4, _IS_BOOL, 0)
ZEND_ARG_INFO(0, statement_resource)
ZEND_ARG_TYPE_INFO(0, column_name, IS_STRING, 0)
- ZEND_ARG_INFO(1, variable)
+ ZEND_ARG_TYPE_INFO(1, variable, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO(0, maximum_array_length, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, maximum_item_length, IS_LONG, 0, "-1")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "SQLT_AFC")
public function rollBack() {}
/**
- * @param mixed $value
+ * @param array|int $value
* @return bool
*/
public function setAttribute(int $attribute, $value) {}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 623f0a96bc1ae5eadcac5ba92eb73189cd3230cd */
+ * Stub hash: 0c7acc78768ad1fb77a09a24ebd4d4e660b350c9 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, dsn, IS_STRING, 0)
/** @return int|false */
public function rowCount() {}
- /**
- * @param mixed $value
- * @return bool
- */
- public function setAttribute(int $attribute, $value) {}
+ /** @return bool */
+ public function setAttribute(int $attribute, mixed $value) {}
/** @return bool */
public function setFetchMode(int $mode, mixed ...$params) {}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 45c43e025d9194f2dd7b2ab13d86a4e5f316fa48 */
+ * Stub hash: 18f2af62bebcbbbf0e298f781860c251cfa07930 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindColumn, 0, 0, 2)
ZEND_ARG_TYPE_MASK(0, column, MAY_BE_STRING|MAY_BE_LONG, NULL)
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_setAttribute, 0, 0, 2)
ZEND_ARG_TYPE_INFO(0, attribute, IS_LONG, 0)
- ZEND_ARG_INFO(0, value)
+ ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_setFetchMode, 0, 0, 1)
/** @return bool */
public function setDefaultStub(?string $index = null, ?string $webindex = null) {}
- /**
- * @param mixed $metadata
- * @return void
- */
- public function setMetadata($metadata) {}
+ /** @return void */
+ public function setMetadata(mixed $metadata) {}
/** @return void */
public function setSignatureAlgorithm(int $algorithm, string $privatekey = UNKNOWN) {}
public function setDefaultStub(?string $index = null, ?string $webindex = null) {}
/**
- * @param mixed $metadata
* @return void
* @alias Phar::setMetadata
*/
- public function setMetadata($metadata) {}
+ public function setMetadata(mixed $metadata) {}
/**
* @return void
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: be0f8bcd0ef8fdac59700160dff7d0beb210aa48 */
+ * Stub hash: d735d786b6804e336f45ac99c80276f5c67d4258 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_setMetadata, 0, 0, 1)
- ZEND_ARG_INFO(0, metadata)
+ ZEND_ARG_TYPE_INFO(0, metadata, IS_MIXED, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_setSignatureAlgorithm, 0, 0, 1)
#define arginfo_class_PharFileInfo_isCRCChecked arginfo_class_Phar___destruct
-ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PharFileInfo_setMetadata, 0, 0, 1)
- ZEND_ARG_TYPE_INFO(0, metadata, IS_MIXED, 0)
-ZEND_END_ARG_INFO()
+#define arginfo_class_PharFileInfo_setMetadata arginfo_class_Phar_setMetadata
ZEND_METHOD(Phar, __construct);
* OID parser (and type, value for SNMP_SET command)
*/
-static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_query, zval *oid, zval *type, zval *value)
+static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_query, zend_string *oid_str, HashTable *oid_ht, zval *type, zval *value)
{
char *pptr;
uint32_t idx_type = 0, idx_value = 0;
zval *tmp_oid, *tmp_type, *tmp_value;
- if (Z_TYPE_P(oid) != IS_ARRAY) {
- convert_to_string_ex(oid);
- }
-
- if (st & SNMP_CMD_SET) {
- if (Z_TYPE_P(type) != IS_ARRAY) {
- convert_to_string_ex(type);
- }
-
- if (Z_TYPE_P(value) != IS_ARRAY) {
- convert_to_string_ex(value);
- }
- }
-
objid_query->count = 0;
objid_query->array_output = ((st & SNMP_CMD_WALK) ? TRUE : FALSE);
- if (Z_TYPE_P(oid) == IS_STRING) {
+ if (oid_str) {
objid_query->vars = (snmpobjarg *)emalloc(sizeof(snmpobjarg));
- objid_query->vars[objid_query->count].oid = Z_STRVAL_P(oid);
+ objid_query->vars[objid_query->count].oid = ZSTR_VAL(oid_str);
if (st & SNMP_CMD_SET) {
if (Z_TYPE_P(type) == IS_STRING && Z_TYPE_P(value) == IS_STRING) {
if (Z_STRLEN_P(type) != 1) {
}
}
objid_query->count++;
- } else if (Z_TYPE_P(oid) == IS_ARRAY) { /* we got objid array */
- if (zend_hash_num_elements(Z_ARRVAL_P(oid)) == 0) {
+ } else if (oid_ht) { /* we got objid array */
+ if (zend_hash_num_elements(oid_ht) == 0) {
php_error_docref(NULL, E_WARNING, "Got empty OID array");
return FALSE;
}
- objid_query->vars = (snmpobjarg *)safe_emalloc(sizeof(snmpobjarg), zend_hash_num_elements(Z_ARRVAL_P(oid)), 0);
+ objid_query->vars = (snmpobjarg *)safe_emalloc(sizeof(snmpobjarg), zend_hash_num_elements(oid_ht), 0);
objid_query->array_output = ( (st & SNMP_CMD_SET) ? FALSE : TRUE );
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(oid), tmp_oid) {
+ ZEND_HASH_FOREACH_VAL(oid_ht, tmp_oid) {
convert_to_string_ex(tmp_oid);
objid_query->vars[objid_query->count].oid = Z_STRVAL_P(tmp_oid);
if (st & SNMP_CMD_SET) {
*/
static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
{
- zval *oid, *value = NULL, *type = NULL;
+ zend_string *oid_str;
+ HashTable *oid_ht;
+ zval *value = NULL, *type = NULL;
char *a1, *a2, *a3, *a4, *a5, *a6, *a7;
size_t a1_len, a2_len, a3_len, a4_len, a5_len, a6_len, a7_len;
zend_bool use_orignames = 0, suffix_keys = 0;
if (session_less_mode) {
if (version == SNMP_VERSION_3) {
if (st & SNMP_CMD_SET) {
- if (zend_parse_parameters(argc, "ssssssszzz|ll", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len,
- &a4, &a4_len, &a5, &a5_len, &a6, &a6_len, &a7, &a7_len, &oid, &type, &value, &timeout, &retries) == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_START(10, 12)
+ Z_PARAM_STRING(a1, a1_len)
+ Z_PARAM_STRING(a2, a2_len)
+ Z_PARAM_STRING(a3, a3_len)
+ Z_PARAM_STRING(a4, a4_len)
+ Z_PARAM_STRING(a5, a5_len)
+ Z_PARAM_STRING(a6, a6_len)
+ Z_PARAM_STRING(a7, a7_len)
+ Z_PARAM_STR_OR_ARRAY_HT(oid_str, oid_ht)
+ Z_PARAM_ZVAL(type)
+ Z_PARAM_ZVAL(value)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(timeout)
+ Z_PARAM_LONG(retries)
+ ZEND_PARSE_PARAMETERS_END();
} else {
/* SNMP_CMD_GET
* SNMP_CMD_GETNEXT
* SNMP_CMD_WALK
*/
- if (zend_parse_parameters(argc, "sssssssz|ll", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len,
- &a4, &a4_len, &a5, &a5_len, &a6, &a6_len, &a7, &a7_len, &oid, &timeout, &retries) == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_START(8, 10)
+ Z_PARAM_STRING(a1, a1_len)
+ Z_PARAM_STRING(a2, a2_len)
+ Z_PARAM_STRING(a3, a3_len)
+ Z_PARAM_STRING(a4, a4_len)
+ Z_PARAM_STRING(a5, a5_len)
+ Z_PARAM_STRING(a6, a6_len)
+ Z_PARAM_STRING(a7, a7_len)
+ Z_PARAM_STR_OR_ARRAY_HT(oid_str, oid_ht)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(timeout)
+ Z_PARAM_LONG(retries)
+ ZEND_PARSE_PARAMETERS_END();
}
} else {
if (st & SNMP_CMD_SET) {
- if (zend_parse_parameters(argc, "sszzz|ll", &a1, &a1_len, &a2, &a2_len, &oid, &type, &value, &timeout, &retries) == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_START(5, 7)
+ Z_PARAM_STRING(a1, a1_len)
+ Z_PARAM_STRING(a2, a2_len)
+ Z_PARAM_STR_OR_ARRAY_HT(oid_str, oid_ht)
+ Z_PARAM_ZVAL(type)
+ Z_PARAM_ZVAL(value)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(timeout)
+ Z_PARAM_LONG(retries)
+ ZEND_PARSE_PARAMETERS_END();
} else {
/* SNMP_CMD_GET
* SNMP_CMD_GETNEXT
* SNMP_CMD_WALK
*/
- if (zend_parse_parameters(argc, "ssz|ll", &a1, &a1_len, &a2, &a2_len, &oid, &timeout, &retries) == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_START(3, 5)
+ Z_PARAM_STRING(a1, a1_len)
+ Z_PARAM_STRING(a2, a2_len)
+ Z_PARAM_STR_OR_ARRAY_HT(oid_str, oid_ht)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(timeout)
+ Z_PARAM_LONG(retries)
+ ZEND_PARSE_PARAMETERS_END();
}
}
} else {
if (st & SNMP_CMD_SET) {
- if (zend_parse_parameters(argc, "zzz", &oid, &type, &value) == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_START(3, 3)
+ Z_PARAM_STR_OR_ARRAY_HT(oid_str, oid_ht)
+ Z_PARAM_ZVAL(type)
+ Z_PARAM_ZVAL(value)
+ ZEND_PARSE_PARAMETERS_END();
} else if (st & SNMP_CMD_WALK) {
- if (zend_parse_parameters(argc, "z|bll", &oid, &suffix_keys, &(objid_query.max_repetitions), &(objid_query.non_repeaters)) == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_STR_OR_ARRAY_HT(oid_str, oid_ht)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(suffix_keys)
+ Z_PARAM_LONG(objid_query.max_repetitions)
+ Z_PARAM_LONG(objid_query.non_repeaters)
+ ZEND_PARSE_PARAMETERS_END();
if (suffix_keys) {
st |= SNMP_USE_SUFFIX_AS_KEYS;
}
} else if (st & SNMP_CMD_GET) {
- if (zend_parse_parameters(argc, "z|b", &oid, &use_orignames) == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR_OR_ARRAY_HT(oid_str, oid_ht)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(use_orignames)
+ ZEND_PARSE_PARAMETERS_END();
if (use_orignames) {
st |= SNMP_ORIGINAL_NAMES_AS_KEYS;
}
} else {
/* SNMP_CMD_GETNEXT
*/
- if (zend_parse_parameters(argc, "z", &oid) == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR_OR_ARRAY_HT(oid_str, oid_ht)
+ ZEND_PARSE_PARAMETERS_END();
}
}
- if (!php_snmp_parse_oid(getThis(), st, &objid_query, oid, type, value)) {
+ if (!php_snmp_parse_oid(getThis(), st, &objid_query, oid_str, oid_ht, type, value)) {
RETURN_FALSE;
}
/** @generate-function-entries */
-/** @param array|string $object_id */
-function snmpget(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN): array|bool {}
+function snmpget(string $host, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
-/** @param array|string $object_id */
-function snmpgetnext(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN): array|bool {}
+function snmpgetnext(string $host, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
-/** @param array|string $object_id */
-function snmpwalk(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN): array|bool {}
+function snmpwalk(string $host, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
-/** @param array|string $object_id */
-function snmprealwalk(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN): array|bool {}
+function snmprealwalk(string $host, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
-/**
- * @param array|string $object_id
- * @alias snmprealwalk
- */
-function snmpwalkoid(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN): array|bool {}
+/** @alias snmprealwalk */
+function snmpwalkoid(string $host, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
/**
- * @param array|string $object_id
* @param array|string $type
* @param array|string $value
*/
-function snmpset(string $host, string $community, $object_id, $type, $value, int $timeout = UNKNOWN, int $retries = UNKNOWN): array|bool {}
+function snmpset(string $host, string $community, array|string $object_id, $type, $value, int $timeout = -1, int $retries = -1): array|bool {}
function snmp_get_quick_print(): bool {}
/** @alias snmp_set_oid_output_format */
function snmp_set_oid_numeric_print(int $oid_format): bool {}
-/** @param array|string $object_id */
-function snmp2_get(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN): array|bool {}
+function snmp2_get(string $host, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
-/** @param array|string $object_id */
-function snmp2_getnext(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN): array|bool {}
+function snmp2_getnext(string $host, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
-/** @param array|string $object_id */
-function snmp2_walk(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN): array|bool {}
+function snmp2_walk(string $host, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
-/** @param array|string $object_id */
-function snmp2_real_walk(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN): array|bool {}
+function snmp2_real_walk(string $host, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
/**
- * @param array|string $object_id
* @param array|string $type
* @param array|string $value
*/
-function snmp2_set(string $host, string $community, $object_id, $type, $value, int $timeout = UNKNOWN, int $retries = UNKNOWN): array|bool {}
+function snmp2_set(string $host, string $community, array|string $object_id, $type, $value, int $timeout = -1, int $retries = -1): array|bool {}
-/** @param array|string $object_id */
-function snmp3_get(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN): array|bool {}
+function snmp3_get(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
-/** @param array|string $object_id */
-function snmp3_getnext(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN): array|bool {}
+function snmp3_getnext(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
-/** @param array|string $object_id */
-function snmp3_walk(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN): array|bool {}
+function snmp3_walk(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
-/** @param array|string $object_id */
-function snmp3_real_walk(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN): array|bool {}
+function snmp3_real_walk(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, array|string $object_id, int $timeout = -1, int $retries = -1): array|bool {}
/**
- * @param array|string $object_id
* @param array|string $type
* @param array|string $value
*/
-function snmp3_set(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, $object_id, $type, $value, int $timeout = UNKNOWN, int $retries = UNKNOWN): array|bool {}
+function snmp3_set(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, array|string $object_id, $type, $value, int $timeout = -1, int $retries = -1): array|bool {}
function snmp_set_valueretrieval(int $method): bool {}
class SNMP
{
- public function __construct(int $version, string $host, string $community, int $timeout = UNKNOWN, int $retries = UNKNOWN) {}
+ public function __construct(int $version, string $host, string $community, int $timeout = -1, int $retries = -1) {}
/** @return bool */
public function close() {}
/** @return bool */
public function setSecurity(string $sec_level, string $auth_protocol = '', string $auth_passphrase = '', string $priv_protocol = '', string $priv_passphrase = '', string $contextName = '', string $contextEngineID = '') {}
- /**
- * @param array|string $object_id
- * @return array|bool
- */
- public function get($object_id, bool $use_orignames = false) {}
+ /** @return array|bool */
+ public function get(array|string $object_id, bool $use_orignames = false) {}
- /**
- * @param array|string $object_id
- * @return array|bool
- */
- public function getnext($object_id) {}
+ /** @return array|bool */
+ public function getnext(array|string $object_id) {}
- /**
- * @param array|string $object_id
- * @return array|bool
- */
- public function walk($object_id, bool $suffix_keys = false, int $max_repetitions = UNKNOWN, int $non_repeaters = UNKNOWN) {}
+ /** @return array|bool */
+ public function walk(array|string $object_id, bool $suffix_keys = false, int $max_repetitions = UNKNOWN, int $non_repeaters = UNKNOWN) {}
/**
- * @param array|string $object_id
* @param array|string $type
* @param array|string $value
* @return array|bool
*/
- public function set($object_id, $type, $value) {}
+ public function set(array|string $object_id, $type, $value) {}
/** @return int */
public function getErrno() {}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 2b0a8233a01de36e93c025bc40c3a2f707825595 */
+ * Stub hash: 02b1dd87856dfdb43039f4544f3e5225a1fb1a6e */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_snmpget, 0, 3, MAY_BE_ARRAY|MAY_BE_BOOL)
ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, community, IS_STRING, 0)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_TYPE_INFO(0, timeout, IS_LONG, 0)
- ZEND_ARG_TYPE_INFO(0, retries, IS_LONG, 0)
+ ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_LONG, 0, "-1")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, retries, IS_LONG, 0, "-1")
ZEND_END_ARG_INFO()
#define arginfo_snmpgetnext arginfo_snmpget
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_snmpset, 0, 5, MAY_BE_ARRAY|MAY_BE_BOOL)
ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, community, IS_STRING, 0)
- ZEND_ARG_INFO(0, object_id)
+ ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
ZEND_ARG_INFO(0, type)
ZEND_ARG_INFO(0, value)
- ZEND_ARG_TYPE_INFO(0, timeout, IS_LONG, 0)
- ZEND_ARG_TYPE_INFO(0, retries, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_LONG, 0, "-1")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, retries, IS_LONG, 0, "-1")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp_get_quick_print, 0, 0, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, auth_passphrase, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, priv_protocol, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, priv_passphrase, IS_STRING, 0)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_TYPE_INFO(0, timeout, IS_LONG, 0)
- ZEND_ARG_TYPE_INFO(0, retries, IS_LONG, 0)
+ ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_LONG, 0, "-1")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, retries, IS_LONG, 0, "-1")
ZEND_END_ARG_INFO()
#define arginfo_snmp3_getnext arginfo_snmp3_get
ZEND_ARG_TYPE_INFO(0, auth_passphrase, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, priv_protocol, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, priv_passphrase, IS_STRING, 0)
- ZEND_ARG_INFO(0, object_id)
+ ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
ZEND_ARG_INFO(0, type)
ZEND_ARG_INFO(0, value)
- ZEND_ARG_TYPE_INFO(0, timeout, IS_LONG, 0)
- ZEND_ARG_TYPE_INFO(0, retries, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_LONG, 0, "-1")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, retries, IS_LONG, 0, "-1")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp_set_valueretrieval, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, version, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, community, IS_STRING, 0)
- ZEND_ARG_TYPE_INFO(0, timeout, IS_LONG, 0)
- ZEND_ARG_TYPE_INFO(0, retries, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_LONG, 0, "-1")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, retries, IS_LONG, 0, "-1")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_close, 0, 0, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_get, 0, 0, 1)
- ZEND_ARG_INFO(0, object_id)
+ ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_orignames, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_getnext, 0, 0, 1)
- ZEND_ARG_INFO(0, object_id)
+ ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_walk, 0, 0, 1)
- ZEND_ARG_INFO(0, object_id)
+ ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, suffix_keys, _IS_BOOL, 0, "false")
ZEND_ARG_TYPE_INFO(0, max_repetitions, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, non_repeaters, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_set, 0, 0, 3)
- ZEND_ARG_INFO(0, object_id)
+ ZEND_ARG_TYPE_MASK(0, object_id, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
ZEND_ARG_INFO(0, type)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
zend_throw_exception(spl_ce_InvalidArgumentException, "Passed variable is not an array or object", 0);
return;
}
-
if (Z_TYPE_P(array) == IS_ARRAY) {
zval_ptr_dtor(&intern->array);
if (Z_REFCOUNT_P(array) == 1) {
return; /* nothing to do */
}
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|zlC", &array, &ar_flags, &ce_get_iterator) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|AlC", &array, &ar_flags, &ce_get_iterator) == FAILURE) {
RETURN_THROWS();
}
return; /* nothing to do */
}
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|zl", &array, &ar_flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|Al", &array, &ar_flags) == FAILURE) {
RETURN_THROWS();
}
zval *object = ZEND_THIS, *array;
spl_array_object *intern = Z_SPLARRAY_P(object);
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "A", &array) == FAILURE) {
RETURN_THROWS();
}
class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Countable
{
- /** @param array|object $input */
- public function __construct($input = [], int $flags = 0, string $iterator_class = ArrayIterator::class) {}
+ public function __construct(array|object $input = [], int $flags = 0, string $iterator_class = ArrayIterator::class) {}
/**
- * @param mixed $index
+ * @param string|int $index
* @return bool
*/
public function offsetExists($index) {}
/**
- * @param mixed $index
+ * @param string|int $index
* @return mixed
*/
public function offsetGet($index) {}
/**
- * @param mixed $index
- * @param mixed $value
+ * @param string|int $index
* @return void
*/
- public function offsetSet($index, $value) {}
+ public function offsetSet($index, mixed $value) {}
/**
- * @param mixed $index
+ * @param string|int $index
* @return void
*/
public function offsetUnset($index) {}
- /**
- * @param mixed $value
- * @return void
- */
- public function append($value) {}
+ /** @return void */
+ public function append(mixed $value) {}
/** @return array */
public function getArrayCopy() {}
/** @return void */
public function setFlags(int $flags) {}
- /**
- * @param int $sort_flags
- * @return bool
- */
- public function asort($sort_flags = SORT_REGULAR) {}
+ /** @return bool */
+ public function asort(int $sort_flags = SORT_REGULAR) {}
- /**
- * @param int $sort_flags
- * @return bool
- */
- public function ksort($sort_flags = SORT_REGULAR) {}
+ /** @return bool */
+ public function ksort(int $sort_flags = SORT_REGULAR) {}
- /**
- * @param callback $cmp_function
- * @return bool
- */
- public function uasort($cmp_function) {}
+ /** @return bool */
+ public function uasort(callable $cmp_function) {}
- /**
- * @param callback $cmp_function
- * @return bool
- */
- public function uksort($cmp_function) {}
+ /** @return bool */
+ public function uksort(callable $cmp_function) {}
/** @return bool */
public function natsort() {}
/** @return Iterator */
public function getIterator() {}
- /**
- * @param array|object $input
- * @return array|null
- */
- public function exchangeArray($input) {}
+ /** @return array|null */
+ public function exchangeArray(array|object $input) {}
/** @return void */
public function setIteratorClass(string $iteratorClass) {}
class ArrayIterator implements SeekableIterator, ArrayAccess, Serializable, Countable
{
- /** @param array|object $array */
- public function __construct($array = [], int $flags = 0) {}
+ public function __construct(array|object $array = [], int $flags = 0) {}
/**
- * @param mixed $index
+ * @param string|int $index
* @return bool
* @alias ArrayObject::offsetExists
*/
public function offsetExists($index) {}
/**
- * @param mixed $index
+ * @param string|int $index
* @return mixed
* @alias ArrayObject::offsetGet
*/
public function offsetGet($index) {}
/**
- * @param mixed $index
- * @param mixed $value
+ * @param string|int $index
* @return void
* @alias ArrayObject::offsetSet
*/
- public function offsetSet($index, $value) {}
+ public function offsetSet($index, mixed $value) {}
/**
- * @param mixed $index
+ * @param string|int $index
* @return void
* @alias ArrayObject::offsetUnset
*/
public function offsetUnset($index) {}
/**
- * @param mixed $value
* @return void
* @alias ArrayObject::append
*/
- public function append($value) {}
+ public function append(mixed $value) {}
/**
* @return array
public function setFlags(int $flags) {}
/**
- * @param int $sort_flags
* @return bool
* @alias ArrayObject::asort
*/
- public function asort($sort_flags = SORT_REGULAR) {}
+ public function asort(int $sort_flags = SORT_REGULAR) {}
/**
- * @param int $sort_flags
* @return bool
* @alias ArrayObject::ksort
*/
- public function ksort($sort_flags = SORT_REGULAR) {}
+ public function ksort(int $sort_flags = SORT_REGULAR) {}
/**
- * @param callback $cmp_function
* @return bool
* @alias ArrayObject::uasort
*/
- public function uasort($cmp_function) {}
+ public function uasort(callable $cmp_function) {}
/**
- * @param callback $cmp_function
* @return bool
* @alias ArrayObject::uksort
*/
- public function uksort($cmp_function) {}
+ public function uksort(callable $cmp_function) {}
/**
* @return bool
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 1230e3161d7c7fb549c5ac2ec5cde2dec585d849 */
+ * Stub hash: bedd13338707177e28a021722df64be2f74a7945 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject___construct, 0, 0, 0)
- ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, input, "[]")
+ ZEND_ARG_TYPE_MASK(0, input, MAY_BE_ARRAY|MAY_BE_OBJECT, "[]")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, iterator_class, IS_STRING, 0, "ArrayIterator::class")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject_offsetSet, 0, 0, 2)
ZEND_ARG_INFO(0, index)
- ZEND_ARG_INFO(0, value)
+ ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
ZEND_END_ARG_INFO()
#define arginfo_class_ArrayObject_offsetUnset arginfo_class_ArrayObject_offsetExists
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject_append, 0, 0, 1)
- ZEND_ARG_INFO(0, value)
+ ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject_getArrayCopy, 0, 0, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject_asort, 0, 0, 0)
- ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, sort_flags, "SORT_REGULAR")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sort_flags, IS_LONG, 0, "SORT_REGULAR")
ZEND_END_ARG_INFO()
#define arginfo_class_ArrayObject_ksort arginfo_class_ArrayObject_asort
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject_uasort, 0, 0, 1)
- ZEND_ARG_INFO(0, cmp_function)
+ ZEND_ARG_TYPE_INFO(0, cmp_function, IS_CALLABLE, 0)
ZEND_END_ARG_INFO()
#define arginfo_class_ArrayObject_uksort arginfo_class_ArrayObject_uasort
#define arginfo_class_ArrayObject_getIterator arginfo_class_ArrayObject_getArrayCopy
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject_exchangeArray, 0, 0, 1)
- ZEND_ARG_INFO(0, input)
+ ZEND_ARG_TYPE_MASK(0, input, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject_setIteratorClass, 0, 0, 1)
#define arginfo_class_ArrayObject___debugInfo arginfo_class_ArrayObject_getArrayCopy
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayIterator___construct, 0, 0, 0)
- ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, array, "[]")
+ ZEND_ARG_TYPE_MASK(0, array, MAY_BE_ARRAY|MAY_BE_OBJECT, "[]")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
/* {{{ Returns whether the requested $index exists. */
PHP_METHOD(SplDoublyLinkedList, offsetExists)
{
- zval *zindex;
spl_dllist_object *intern;
- zend_long index;
+ zend_long index;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &index) == FAILURE) {
RETURN_THROWS();
}
intern = Z_SPLDLLIST_P(ZEND_THIS);
- index = spl_offset_convert_to_long(zindex);
RETURN_BOOL(index >= 0 && index < intern->llist->count);
} /* }}} */
/* {{{ Returns the value at the specified $index. */
PHP_METHOD(SplDoublyLinkedList, offsetGet)
{
- zval *zindex;
zend_long index;
spl_dllist_object *intern;
spl_ptr_llist_element *element;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &index) == FAILURE) {
RETURN_THROWS();
}
intern = Z_SPLDLLIST_P(ZEND_THIS);
- index = spl_offset_convert_to_long(zindex);
if (index < 0 || index >= intern->llist->count) {
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0);
+ zend_argument_error(spl_ce_OutOfRangeException, 1, "is out of range");
RETURN_THROWS();
}
element = spl_ptr_llist_offset(intern->llist, index, intern->flags & SPL_DLLIST_IT_LIFO);
-
- if (element != NULL) {
- zval *value = &element->data;
-
- ZVAL_COPY_DEREF(return_value, value);
- } else {
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0);
+ if (element == NULL) {
+ zend_argument_error(spl_ce_OutOfRangeException, 1, "is an invalid offset");
+ RETURN_THROWS();
}
+
+ ZVAL_COPY_DEREF(return_value, &element->data);
} /* }}} */
/* {{{ Sets the value at the specified $index to $newval. */
PHP_METHOD(SplDoublyLinkedList, offsetSet)
{
- zval *zindex, *value;
- spl_dllist_object *intern;
+ zend_long index;
+ zend_bool index_is_null = 1;
+ zval *value;
+ spl_dllist_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &zindex, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l!z", &index, &index_is_null, &value) == FAILURE) {
RETURN_THROWS();
}
intern = Z_SPLDLLIST_P(ZEND_THIS);
- if (Z_TYPE_P(zindex) == IS_NULL) {
+ if (index_is_null) {
/* $obj[] = ... */
spl_ptr_llist_push(intern->llist, value);
} else {
/* $obj[$foo] = ... */
- zend_long index;
spl_ptr_llist_element *element;
- index = spl_offset_convert_to_long(zindex);
-
if (index < 0 || index >= intern->llist->count) {
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0);
+ zend_argument_error(spl_ce_OutOfRangeException, 1, "is out of range");
RETURN_THROWS();
}
}
} else {
zval_ptr_dtor(value);
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0);
+ zend_argument_error(spl_ce_OutOfRangeException, 1, "is an invalid offset");
RETURN_THROWS();
}
}
/* {{{ Unsets the value at the specified $index. */
PHP_METHOD(SplDoublyLinkedList, offsetUnset)
{
- zval *zindex;
zend_long index;
spl_dllist_object *intern;
spl_ptr_llist_element *element;
spl_ptr_llist *llist;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &index) == FAILURE) {
RETURN_THROWS();
}
intern = Z_SPLDLLIST_P(ZEND_THIS);
- index = spl_offset_convert_to_long(zindex);
llist = intern->llist;
if (index < 0 || index >= intern->llist->count) {
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset out of range", 0);
+ zend_argument_error(spl_ce_OutOfRangeException, 1, "is out of range");
RETURN_THROWS();
}
SPL_LLIST_DELREF(element);
} else {
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0);
+ zend_argument_error(spl_ce_OutOfRangeException, 1, "is an invalid offset");
RETURN_THROWS();
}
} /* }}} */
if (element == NULL || Z_ISUNDEF(element->data)) {
RETURN_NULL();
} else {
- zval *value = &element->data;
-
- ZVAL_COPY_DEREF(return_value, value);
+ ZVAL_COPY_DEREF(return_value, &element->data);
}
}
/* }}} */
/* {{{ Inserts a new entry before the specified $index consisting of $newval. */
PHP_METHOD(SplDoublyLinkedList, add)
{
- zval *zindex, *value;
+ zval *value;
spl_dllist_object *intern;
spl_ptr_llist_element *element;
zend_long index;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &zindex, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lz", &index, &value) == FAILURE) {
RETURN_THROWS();
}
intern = Z_SPLDLLIST_P(ZEND_THIS);
- index = spl_offset_convert_to_long(zindex);
if (index < 0 || index > intern->llist->count) {
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0);
+ zend_argument_error(spl_ce_OutOfRangeException, 1, "is out of range");
RETURN_THROWS();
}
class SplDoublyLinkedList implements Iterator, Countable, ArrayAccess, Serializable
{
- /**
- * @param mixed $index
- * @param mixed $value
- * @return void
- */
- public function add($index, $value) {}
+ /** @return void */
+ public function add(int $index, mixed $value) {}
/** @return mixed */
public function pop() {}
/** @return mixed */
public function shift() {}
- /**
- * @param mixed $value
- * @return void
- */
- public function push($value) {}
+ /** @return void */
+ public function push(mixed $value) {}
- /**
- * @param mixed $value
- * @return void
- */
- public function unshift($value) {}
+ /** @return void */
+ public function unshift(mixed $value) {}
/** @return mixed */
public function top() {}
public function offsetExists($index) {}
/**
- * @param mixed $index
+ * @param int $index
* @return mixed
*/
public function offsetGet($index) {}
/**
- * @param mixed $index
- * @param mixed $value
+ * @param int|null $index
* @return void
*/
- public function offsetSet($index, $value) {}
+ public function offsetSet($index, mixed $value) {}
/**
- * @param mixed $index
+ * @param int $index
* @return void
*/
public function offsetUnset($index) {}
class SplQueue extends SplDoublyLinkedList
{
/**
- * @param mixed $value
* @return void
* @alias SplDoublyLinkedList::push
*/
- public function enqueue($value) {}
+ public function enqueue(mixed $value) {}
/**
* @return mixed
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 9d2c9ec251d72065d4502bbbc29e927c6b597731 */
+ * Stub hash: 26a454261393ea3bdb6252b2d8140434664b5771 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplDoublyLinkedList_add, 0, 0, 2)
- ZEND_ARG_INFO(0, index)
- ZEND_ARG_INFO(0, value)
+ ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplDoublyLinkedList_pop, 0, 0, 0)
#define arginfo_class_SplDoublyLinkedList_shift arginfo_class_SplDoublyLinkedList_pop
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplDoublyLinkedList_push, 0, 0, 1)
- ZEND_ARG_INFO(0, value)
+ ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
ZEND_END_ARG_INFO()
#define arginfo_class_SplDoublyLinkedList_unshift arginfo_class_SplDoublyLinkedList_push
#define arginfo_class_SplDoublyLinkedList_offsetGet arginfo_class_SplDoublyLinkedList_offsetExists
-#define arginfo_class_SplDoublyLinkedList_offsetSet arginfo_class_SplDoublyLinkedList_add
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplDoublyLinkedList_offsetSet, 0, 0, 2)
+ ZEND_ARG_INFO(0, index)
+ ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
+ZEND_END_ARG_INFO()
#define arginfo_class_SplDoublyLinkedList_offsetUnset arginfo_class_SplDoublyLinkedList_offsetExists
public function setSize(int $size) {}
/**
- * @param mixed $index
+ * @param int $index
* @return bool
*/
public function offsetExists($index) {}
/**
- * @param mixed $index
+ * @param int $index
* @return mixed
*/
public function offsetGet($index) {}
/**
- * @param mixed $index
- * @param mixed $value
+ * @param int $index
* @return void
*/
- public function offsetSet($index, $value) {}
+ public function offsetSet($index, mixed $value) {}
/**
* @param int $index
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: a14156d542422823fcee53eb8a151576d055f38f */
+ * Stub hash: 4b6c37c54416ee46f610baba2a8b2be45d1db96f */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFixedArray___construct, 0, 0, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, size, IS_LONG, 0, "0")
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFixedArray_offsetSet, 0, 0, 2)
ZEND_ARG_INFO(0, index)
- ZEND_ARG_INFO(0, value)
+ ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
ZEND_END_ARG_INFO()
#define arginfo_class_SplFixedArray_offsetUnset arginfo_class_SplFixedArray_offsetExists
class SplPriorityQueue implements Iterator, Countable
{
- /**
- * @param mixed $priority1
- * @param mixed $priority2
- * @return int
- */
- public function compare($priority1, $priority2) {}
+ /** @return int */
+ public function compare(mixed $priority1, mixed $priority2) {}
- /**
- * @param mixed $value
- * @param mixed $priority
- * @return bool
- */
- public function insert($value, $priority) {}
+ /** @return bool */
+ public function insert(mixed $value, mixed $priority) {}
/** @return int */
public function setExtractFlags(int $flags) {}
/** @return mixed */
public function extract() {}
- /**
- * @param mixed $value
- * @return bool
- */
- public function insert($value) {}
+ /** @return bool */
+ public function insert(mixed $value) {}
/** @return mixed */
public function top() {}
/** @return bool */
public function recoverFromCorruption() {}
- /**
- * @param mixed $value1
- * @param mixed $value2
- * @return int
- */
- abstract protected function compare($value1, $value2);
+ /** @return int */
+ abstract protected function compare(mixed $value1, mixed $value2);
/** @return bool */
public function isCorrupted() {}
class SplMinHeap extends SplHeap
{
- /**
- * @param mixed $value1
- * @param mixed $value2
- * @return int
- */
- protected function compare($value1, $value2) {}
+ /** @return int */
+ protected function compare(mixed $value1, mixed $value2) {}
}
class SplMaxHeap extends SplHeap
{
- /**
- * @param mixed $value1
- * @param mixed $value2
- * @return int
- */
- protected function compare($value1, $value2) {}
+ /** @return int */
+ protected function compare(mixed $value1, mixed $value2) {}
}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 7f0aaeba31232e23367618eae98398fa41ac6ef5 */
+ * Stub hash: e57b1d7e9139aa2759f548cf800857cccf1d1f25 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplPriorityQueue_compare, 0, 0, 2)
- ZEND_ARG_INFO(0, priority1)
- ZEND_ARG_INFO(0, priority2)
+ ZEND_ARG_TYPE_INFO(0, priority1, IS_MIXED, 0)
+ ZEND_ARG_TYPE_INFO(0, priority2, IS_MIXED, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplPriorityQueue_insert, 0, 0, 2)
- ZEND_ARG_INFO(0, value)
- ZEND_ARG_INFO(0, priority)
+ ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
+ ZEND_ARG_TYPE_INFO(0, priority, IS_MIXED, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplPriorityQueue_setExtractFlags, 0, 0, 1)
#define arginfo_class_SplHeap_extract arginfo_class_SplPriorityQueue_top
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplHeap_insert, 0, 0, 1)
- ZEND_ARG_INFO(0, value)
+ ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
ZEND_END_ARG_INFO()
#define arginfo_class_SplHeap_top arginfo_class_SplPriorityQueue_top
#define arginfo_class_SplHeap_recoverFromCorruption arginfo_class_SplPriorityQueue_top
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplHeap_compare, 0, 0, 2)
- ZEND_ARG_INFO(0, value1)
- ZEND_ARG_INFO(0, value2)
+ ZEND_ARG_TYPE_INFO(0, value1, IS_MIXED, 0)
+ ZEND_ARG_TYPE_INFO(0, value2, IS_MIXED, 0)
ZEND_END_ARG_INFO()
#define arginfo_class_SplHeap_isCorrupted arginfo_class_SplPriorityQueue_top
class RecursiveIteratorIterator implements OuterIterator
{
- /** @param Traversable $iterator */
public function __construct(Traversable $iterator, int $mode = self::LEAVES_ONLY, int $flags = 0) {}
/** @return void */
/**
* @param string $index
- * @param mixed $value
* @return void
*/
- public function offsetSet($index, $value) {}
+ public function offsetSet($index, mixed $value) {}
/**
* @param string $index
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: fcf9d56587eb60bdc7824ff7587a5c7365eee5c0 */
+ * Stub hash: 3d98c82203230f2636c7fedb5717da5f7ab973f2 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_EmptyIterator_current, 0, 0, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_CachingIterator_offsetSet, 0, 0, 2)
ZEND_ARG_INFO(0, index)
- ZEND_ARG_INFO(0, value)
+ ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
ZEND_END_ARG_INFO()
#define arginfo_class_CachingIterator_offsetUnset arginfo_class_CachingIterator_offsetGet
class SplObjectStorage implements Countable, Iterator, Serializable, ArrayAccess
{
- /**
- * @param mixed $info
- * @return void
- */
- public function attach(object $object, $info = null) {}
+ /** @return void */
+ public function attach(object $object, mixed $info = null) {}
/** @return void */
public function detach(object $object) {}
/** @return mixed */
public function getInfo() {}
- /**
- * @param mixed $info
- * @return void
- */
- public function setInfo($info) {}
+ /** @return void */
+ public function setInfo(mixed $info) {}
/** @return int */
public function count(int $mode = COUNT_NORMAL) {}
/**
* @param object $object
- * @param mixed $info
* @return void
* @alias SplObjectStorage::attach
*/
- public function offsetSet($object, $info = null) {}
+ public function offsetSet($object, mixed $info = null) {}
/**
* @param object $object
public function setFlags(int $flags) {}
/**
- * @param Iterator $iterator
* @param int|string|null $info
* @return void
*/
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 4a31f2cc1b0c874f1256aef60afbd285dbe6c078 */
+ * Stub hash: f795244462fc7b6aed3f38f6b2e1985b3a2ab7c1 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplObserver_update, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, subject, SplSubject, 0)
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplObjectStorage_attach, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0)
- ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, info, "null")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, info, IS_MIXED, 0, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplObjectStorage_detach, 0, 0, 1)
#define arginfo_class_SplObjectStorage_getInfo arginfo_class_SplSubject_notify
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplObjectStorage_setInfo, 0, 0, 1)
- ZEND_ARG_INFO(0, info)
+ ZEND_ARG_TYPE_INFO(0, info, IS_MIXED, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplObjectStorage_count, 0, 0, 0)
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplObjectStorage_offsetSet, 0, 0, 1)
ZEND_ARG_INFO(0, object)
- ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, info, "null")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, info, IS_MIXED, 0, "null")
ZEND_END_ARG_INFO()
#define arginfo_class_SplObjectStorage_offsetUnset arginfo_class_SplObjectStorage_offsetExists
}
?>
--EXPECT--
-Exception: Offset invalid or out of range
+Exception: SplDoublyLinkedList::add(): Argument #1 ($index) is out of range
<?php
try {
$dll = new SplDoublyLinkedList();
- var_dump($dll->add(NULL,2));
-} catch (OutOfRangeException $e) {
+ var_dump($dll->add([],2));
+} catch (TypeError $e) {
echo "Exception: ".$e->getMessage()."\n";
}
?>
--EXPECT--
-Exception: Offset invalid or out of range
+Exception: SplDoublyLinkedList::add(): Argument #1 ($index) must be of type int, array given
?>
--EXPECTF--
-Fatal error: Uncaught OutOfRangeException: Offset invalid or out of range in %s
+Fatal error: Uncaught TypeError: SplDoublyLinkedList::offsetGet(): Argument #1 ($index) must be of type int, array given in %s
Stack trace:
#0 %s
#1 {main}
?>
--EXPECTF--
-Fatal error: Uncaught OutOfRangeException: Offset invalid or out of range in %s
+Fatal error: Uncaught TypeError: SplDoublyLinkedList::offsetGet(): Argument #1 ($index) must be of type int, string given in %s
Stack trace:
#0 %s
#1 {main}
?>
--EXPECT--
-Offset out of range
+SplDoublyLinkedList::offsetUnset(): Argument #1 ($index) is out of range
}
?>
--EXPECT--
-Offset out of range
+SplDoublyLinkedList::offsetUnset(): Argument #1 ($index) is out of range
}
?>
--EXPECT--
-Offset out of range
+SplDoublyLinkedList::offsetUnset(): Argument #1 ($index) is out of range
try {
$copy = $ao->exchangeArray(null);
$copy['addedToCopy'] = 'added To Copy';
-} catch (Exception $e) {
- echo "Exception:" . $e->getMessage() . "\n";
+} catch (TypeError $e) {
+ echo $e->getMessage() . "\n";
}
$original->addedToOriginal = 'added To Original';
var_dump($ao, $original, $copy);
--> exchangeArray() with bad arg type:
-Exception:Passed variable is not an array or object
+ArrayObject::exchangeArray(): Argument #1 ($input) must be of type array, null given
Warning: Undefined variable $copy in %s on line %d
object(ArrayObject)#3 (1) {
Method [ <internal:SPL, ctor> public method __construct ] {
- Parameters [2] {
- Parameter #0 [ <optional> $array = [] ]
+ Parameter #0 [ <optional> object|array $array = [] ]
Parameter #1 [ <optional> int $flags = 0 ]
}
}
}
?>
--EXPECT--
-Offset invalid or out of range
+SplDoublyLinkedList::offsetSet(): Argument #1 ($index) is out of range
try {
var_dump($a["a"]);
-} catch (OutOfRangeException $e) {
+} catch (TypeError $e) {
echo "Exception: ".$e->getMessage()."\n";
}
int(3)
int(4)
int(2)
-Exception: Offset invalid or out of range
+Exception: SplDoublyLinkedList::offsetGet(): Argument #1 ($index) must be of type int, string given
int(1)
-Exception: Offset invalid or out of range
+Exception: SplDoublyLinkedList::offsetGet(): Argument #1 ($index) is out of range
echo $dll->pop()."\n";
?>
--EXPECT--
-Exception: Offset invalid or out of range
+Exception: SplDoublyLinkedList::add(): Argument #1 ($index) is out of range
7
7
6
var_dump($test->current());
try {
$output = $test->callGetChildren();
-} catch (InvalidArgumentException $ilae){
+} catch (TypeError $exception) {
$output = null;
- print "invalid argument exception\n";
+ echo $exception->getMessage() . "\n";
}
var_dump($output);
?>
--EXPECT--
- array(3) {
+array(3) {
[0]=>
int(7)
[1]=>
int(9)
}
int(7)
-invalid argument exception
+ArrayIterator::__construct(): Argument #1 ($array) must be of type array, int given
NULL
} \
obj = Z_TIDY_P(object); \
-#define TIDY_APPLY_CONFIG_ZVAL(_doc, _val) \
- if(_val) { \
- if(Z_TYPE_P(_val) == IS_ARRAY) { \
- _php_tidy_apply_config_array(_doc, Z_ARRVAL_P(_val)); \
- } else { \
- convert_to_string_ex(_val); \
- TIDY_OPEN_BASE_DIR_CHECK(Z_STRVAL_P(_val)); \
- switch (tidyLoadConfig(_doc, Z_STRVAL_P(_val))) { \
- case -1: \
- php_error_docref(NULL, E_WARNING, "Could not load configuration file \"%s\"", Z_STRVAL_P(_val)); \
- break; \
- case 1: \
- php_error_docref(NULL, E_NOTICE, "There were errors while parsing the configuration file \"%s\"", Z_STRVAL_P(_val)); \
- break; \
- } \
- } \
- }
+#define TIDY_APPLY_CONFIG(_doc, _val_str, _val_ht) \
+ if (_val_ht) { \
+ _php_tidy_apply_config_array(_doc, _val_ht); \
+ } else if (_val_str) { \
+ TIDY_OPEN_BASE_DIR_CHECK(ZSTR_VAL(_val_str)); \
+ switch (tidyLoadConfig(_doc, ZSTR_VAL(_val_str))) { \
+ case -1: \
+ php_error_docref(NULL, E_WARNING, "Could not load configuration file \"%s\"", ZSTR_VAL(_val_str)); \
+ break; \
+ case 1: \
+ php_error_docref(NULL, E_NOTICE, "There were errors while parsing the configuration file \"%s\"", ZSTR_VAL(_val_str)); \
+ break; \
+ } \
+ }
#define REGISTER_TIDY_CLASS(classname, name, parent, __flags) \
{ \
size_t enc_len = 0;
TidyDoc doc;
TidyBuffer *errbuf;
- zend_string *data, *arg1;
- zval *config = NULL;
+ zend_string *data, *arg1, *config_str = NULL;
+ HashTable *config_ht = NULL;
if (is_file) {
zend_bool use_include_path = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|zsb", &arg1, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_PATH_STR(arg1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(config_str, config_ht)
+ Z_PARAM_STRING(enc, enc_len)
+ Z_PARAM_BOOL(use_include_path)
+ ZEND_PARSE_PARAMETERS_END();
+
if (!(data = php_tidy_file_to_mem(ZSTR_VAL(arg1), use_include_path))) {
RETURN_FALSE;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|zs", &arg1, &config, &enc, &enc_len) == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(arg1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(config_str, config_ht)
+ Z_PARAM_STRING(enc, enc_len)
+ ZEND_PARSE_PARAMETERS_END();
+
data = arg1;
}
TIDY_SET_DEFAULT_CONFIG(doc);
- if (config) {
- TIDY_APPLY_CONFIG_ZVAL(doc, config);
- }
+ TIDY_APPLY_CONFIG(doc, config_str, config_ht);
if(enc_len) {
if (tidySetCharEncoding(doc, enc) < 0) {
{
char *enc = NULL;
size_t enc_len = 0;
- zend_string *input;
- zval *options = NULL;
+ zend_string *input, *options_str = NULL;
+ HashTable *options_ht = NULL;
PHPTidyObj *obj;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|zs", &input, &options, &enc, &enc_len) == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(input)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(options_str, options_ht)
+ Z_PARAM_STRING(enc, enc_len)
+ ZEND_PARSE_PARAMETERS_END();
if (ZEND_SIZE_T_UINT_OVFL(ZSTR_LEN(input))) {
zend_argument_value_error(1, "is too long");
tidy_instanciate(tidy_ce_doc, return_value);
obj = Z_TIDY_P(return_value);
- TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
+ TIDY_APPLY_CONFIG(obj->ptdoc->doc, options_str, options_ht);
if (php_tidy_parse_string(obj, ZSTR_VAL(input), (uint32_t)ZSTR_LEN(input), enc) == FAILURE) {
zval_ptr_dtor(return_value);
char *enc = NULL;
size_t enc_len = 0;
zend_bool use_include_path = 0;
- zend_string *inputfile, *contents;
- zval *options = NULL;
+ zend_string *inputfile, *contents, *options_str = NULL;
+ HashTable *options_ht = NULL;
PHPTidyObj *obj;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|zsb", &inputfile,
- &options, &enc, &enc_len, &use_include_path) == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_PATH_STR(inputfile)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(options_str, options_ht)
+ Z_PARAM_STRING(enc, enc_len)
+ Z_PARAM_BOOL(use_include_path)
+ ZEND_PARSE_PARAMETERS_END();
tidy_instanciate(tidy_ce_doc, return_value);
obj = Z_TIDY_P(return_value);
RETURN_THROWS();
}
- TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
+ TIDY_APPLY_CONFIG(obj->ptdoc->doc, options_str, options_ht);
if (php_tidy_parse_string(obj, ZSTR_VAL(contents), (uint32_t)ZSTR_LEN(contents), enc) == FAILURE) {
zval_ptr_dtor(return_value);
char *enc = NULL;
size_t enc_len = 0;
zend_bool use_include_path = 0;
- zval *options = NULL;
- zend_string *contents, *inputfile = NULL;
-
+ HashTable *options_ht = NULL;
+ zend_string *contents, *inputfile = NULL, *options_str = NULL;
PHPTidyObj *obj;
- TIDY_SET_CONTEXT;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|Pzsb", &inputfile,
- &options, &enc, &enc_len, &use_include_path) == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_START(0, 4)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_PATH_STR_OR_NULL(inputfile)
+ Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(options_str, options_ht)
+ Z_PARAM_STRING(enc, enc_len)
+ Z_PARAM_BOOL(use_include_path)
+ ZEND_PARSE_PARAMETERS_END();
+ TIDY_SET_CONTEXT;
obj = Z_TIDY_P(object);
if (inputfile) {
RETURN_THROWS();
}
- TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
+ TIDY_APPLY_CONFIG(obj->ptdoc->doc, options_str, options_ht);
php_tidy_parse_string(obj, ZSTR_VAL(contents), (uint32_t)ZSTR_LEN(contents), enc);
char *enc = NULL;
size_t enc_len = 0;
zend_bool use_include_path = 0;
- zval *options = NULL;
- zend_string *inputfile, *contents;
+ HashTable *options_ht = NULL;
+ zend_string *inputfile, *contents, *options_str = NULL;
PHPTidyObj *obj;
- TIDY_SET_CONTEXT;
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_PATH_STR(inputfile)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(options_str, options_ht)
+ Z_PARAM_STRING(enc, enc_len)
+ Z_PARAM_BOOL(use_include_path)
+ ZEND_PARSE_PARAMETERS_END();
+ TIDY_SET_CONTEXT;
obj = Z_TIDY_P(object);
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|zsb", &inputfile,
- &options, &enc, &enc_len, &use_include_path) == FAILURE) {
- RETURN_THROWS();
- }
-
if (!(contents = php_tidy_file_to_mem(ZSTR_VAL(inputfile), use_include_path))) {
php_error_docref(NULL, E_WARNING, "Cannot load \"%s\" into memory%s", ZSTR_VAL(inputfile), (use_include_path) ? " (using include path)" : "");
RETURN_FALSE;
RETURN_THROWS();
}
- TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
+ TIDY_APPLY_CONFIG(obj->ptdoc->doc, options_str, options_ht);
if (php_tidy_parse_string(obj, ZSTR_VAL(contents), (uint32_t)ZSTR_LEN(contents), enc) == FAILURE) {
RETVAL_FALSE;
{
char *enc = NULL;
size_t enc_len = 0;
- zval *options = NULL;
+ HashTable *options_ht = NULL;
PHPTidyObj *obj;
- zend_string *input;
-
- TIDY_SET_CONTEXT;
+ zend_string *input, *options_str = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|zs", &input, &options, &enc, &enc_len) == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STR(input)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(options_str, options_ht)
+ Z_PARAM_STRING(enc, enc_len)
+ ZEND_PARSE_PARAMETERS_END();
if (ZEND_SIZE_T_UINT_OVFL(ZSTR_LEN(input))) {
zend_argument_value_error(1, "is too long");
RETURN_THROWS();
}
+ TIDY_SET_CONTEXT;
obj = Z_TIDY_P(object);
- TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
+ TIDY_APPLY_CONFIG(obj->ptdoc->doc, options_str, options_ht);
if(php_tidy_parse_string(obj, ZSTR_VAL(input), (uint32_t)ZSTR_LEN(input), enc) == SUCCESS) {
RETURN_TRUE;
/** @generate-function-entries */
-/** @param array|string $config_options */
-function tidy_parse_string(string $input, $config_options = UNKNOWN, string $encoding = UNKNOWN): tidy|false {}
+function tidy_parse_string(string $input, array|string|null $config_options = null, string $encoding = UNKNOWN): tidy|false {}
function tidy_get_error_buffer(tidy $object): string|false {}
function tidy_get_output(tidy $object): string {}
-/** @param array|string $config_options */
-function tidy_parse_file(string $file, $config_options = UNKNOWN, string $encoding = UNKNOWN, bool $use_include_path = false): tidy|false {}
+function tidy_parse_file(string $file, array|string|null $config_options = null, string $encoding = UNKNOWN, bool $use_include_path = false): tidy|false {}
function tidy_clean_repair(tidy $object): bool {}
-/** @param array|string $config_options */
-function tidy_repair_string(string $data, $config_options = UNKNOWN, string $encoding = UNKNOWN): string|false {}
+function tidy_repair_string(string $data, array|string|null $config_options = null, string $encoding = UNKNOWN): string|false {}
-/** @param array|string $config_options */
-function tidy_repair_file(string $filename, $config_options = UNKNOWN, string $encoding = UNKNOWN, bool $use_include_path = false): string|false {}
+function tidy_repair_file(string $filename, array|string|null $config_options = null, string $encoding = UNKNOWN, bool $use_include_path = false): string|false {}
function tidy_diagnose(tidy $object): bool {}
class tidy
{
- /** @param array|string $config_options */
- public function __construct(string $filename = UNKNOWN, $config_options = UNKNOWN, string $encoding = UNKNOWN, bool $use_include_path = false) {}
+ public function __construct(?string $filename = null, array|string|null $config_options = null, string $encoding = UNKNOWN, bool $use_include_path = false) {}
/**
* @return string|int|bool
*/
public function cleanRepair() {}
- /**
- * @param array|string $config_options
- * @return bool
- */
- public function parseFile(string $file, $config_options = UNKNOWN, string $encoding = UNKNOWN, bool $use_include_path = false) {}
+ /** @return bool */
+ public function parseFile(string $file, array|string|null $config_options = null, string $encoding = UNKNOWN, bool $use_include_path = false) {}
- /**
- * @param array|string $config_options
- * @return bool
- */
- public function parseString(string $input, $config_options = UNKNOWN, string $encoding = UNKNOWN) {}
+ /** @return bool */
+ public function parseString(string $input, array|string|null $config_options = null, string $encoding = UNKNOWN) {}
/**
- * @param array|string $config_options
* @return bool
* @alias tidy_repair_string
*/
- public function repairString(string $data, $config_options = UNKNOWN, string $encoding = UNKNOWN) {}
+ public function repairString(string $data, array|string|null $config_options = null, string $encoding = UNKNOWN) {}
/**
- * @param array|string $config_options
* @return bool
* @alias tidy_repair_file
*/
- public function repairFile(string $filename, $config_options = UNKNOWN, string $encoding = UNKNOWN, bool $use_include_path = false) {}
+ public function repairFile(string $filename, array|string|null $config_options = null, string $encoding = UNKNOWN, bool $use_include_path = false) {}
/**
* @return bool
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 962dc7537b44115477b38efaefefa352e06b13bf */
+ * Stub hash: cc7cee7934007aa4b195fb1be0626496937e9d38 */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_tidy_parse_string, 0, 1, tidy, MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0)
- ZEND_ARG_INFO(0, config_options)
+ ZEND_ARG_TYPE_MASK(0, config_options, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_tidy_parse_file, 0, 1, tidy, MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, file, IS_STRING, 0)
- ZEND_ARG_INFO(0, config_options)
+ ZEND_ARG_TYPE_MASK(0, config_options, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_include_path, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_tidy_repair_string, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
- ZEND_ARG_INFO(0, config_options)
+ ZEND_ARG_TYPE_MASK(0, config_options, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_tidy_repair_file, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
- ZEND_ARG_INFO(0, config_options)
+ ZEND_ARG_TYPE_MASK(0, config_options, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_include_path, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_tidy___construct, 0, 0, 0)
- ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
- ZEND_ARG_INFO(0, config_options)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null")
+ ZEND_ARG_TYPE_MASK(0, config_options, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_include_path, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_tidy_parseFile, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, file, IS_STRING, 0)
- ZEND_ARG_INFO(0, config_options)
+ ZEND_ARG_TYPE_MASK(0, config_options, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_include_path, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_tidy_parseString, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0)
- ZEND_ARG_INFO(0, config_options)
+ ZEND_ARG_TYPE_MASK(0, config_options, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_tidy_repairString, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
- ZEND_ARG_INFO(0, config_options)
+ ZEND_ARG_TYPE_MASK(0, config_options, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_tidy_repairFile, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
- ZEND_ARG_INFO(0, config_options)
+ ZEND_ARG_TYPE_MASK(0, config_options, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_include_path, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()