]> granicus.if.org Git - php/commitdiff
Add more precise type info for stubs
authorMáté Kocsis <kocsismate@woohoolabs.com>
Fri, 14 Aug 2020 15:36:20 +0000 (17:36 +0200)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Tue, 1 Sep 2020 14:35:56 +0000 (16:35 +0200)
Closes GH-6005

63 files changed:
Zend/zend_API.h
Zend/zend_weakrefs.stub.php
Zend/zend_weakrefs_arginfo.h
ext/com_dotnet/com_com.c
ext/com_dotnet/com_extension.stub.php
ext/com_dotnet/com_extension_arginfo.h
ext/ctype/ctype.stub.php
ext/ctype/ctype_arginfo.h
ext/ffi/ffi.c
ext/ffi/ffi.stub.php
ext/ffi/ffi_arginfo.h
ext/intl/calendar/calendar.stub.php
ext/intl/calendar/calendar_arginfo.h
ext/intl/calendar/calendar_methods.cpp
ext/intl/dateformat/dateformat.stub.php
ext/intl/dateformat/dateformat_arginfo.h
ext/intl/intl_data.h
ext/intl/php_intl.stub.php
ext/intl/php_intl_arginfo.h
ext/intl/timezone/timezone.stub.php
ext/intl/timezone/timezone_arginfo.h
ext/intl/transliterator/transliterator_methods.c
ext/oci8/oci8.stub.php
ext/oci8/oci8_arginfo.h
ext/pdo/pdo_dbh.stub.php
ext/pdo/pdo_dbh_arginfo.h
ext/pdo/pdo_stmt.stub.php
ext/pdo/pdo_stmt_arginfo.h
ext/phar/phar_object.stub.php
ext/phar/phar_object_arginfo.h
ext/snmp/snmp.c
ext/snmp/snmp.stub.php
ext/snmp/snmp_arginfo.h
ext/spl/spl_array.c
ext/spl/spl_array.stub.php
ext/spl/spl_array_arginfo.h
ext/spl/spl_dllist.c
ext/spl/spl_dllist.stub.php
ext/spl/spl_dllist_arginfo.h
ext/spl/spl_fixedarray.stub.php
ext/spl/spl_fixedarray_arginfo.h
ext/spl/spl_heap.stub.php
ext/spl/spl_heap_arginfo.h
ext/spl/spl_iterators.stub.php
ext/spl/spl_iterators_arginfo.h
ext/spl/spl_observer.stub.php
ext/spl/spl_observer_arginfo.h
ext/spl/tests/SplDoublyLinkedList_add_invalid_offset.phpt
ext/spl/tests/SplDoublyLinkedList_add_null_offset.phpt
ext/spl/tests/SplDoublyLinkedList_offsetGet_param_array.phpt
ext/spl/tests/SplDoublyLinkedList_offsetGet_param_string.phpt
ext/spl/tests/SplDoublyLinkedList_offsetUnset_greater_than_elements.phpt
ext/spl/tests/SplDoublyLinkedList_offsetUnset_negative-parameter.phpt
ext/spl/tests/SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.phpt
ext/spl/tests/arrayObject_exchangeArray_basic3.phpt
ext/spl/tests/bug71412.phpt
ext/spl/tests/bug71735.phpt
ext/spl/tests/dllist_006.phpt
ext/spl/tests/dllist_013.phpt
ext/spl/tests/spl_iterator_getcallchildren.phpt
ext/tidy/tidy.c
ext/tidy/tidy.stub.php
ext/tidy/tidy_arginfo.h

index d46fe6968a17f851031d3973e9d5aff8036a97cd..70e757c1bb630520aac1b1dfdc9d0863cef4a269 100644 (file)
@@ -1634,6 +1634,9 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
 #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); \
index 4074ac012284707c8d7c948154f0b1838c814bdb..c341e0a46366447ced76e032b7a8de4c3f7e0176 100644 (file)
@@ -15,15 +15,11 @@ final class WeakMap implements ArrayAccess, Countable, IteratorAggregate
 {
     /**
      * @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 {}
index 43d206a897829da8ed07e215e77d8045afb12f09..da953a9800e2bfb2b6396f61e8e0508700672e1b 100644 (file)
@@ -1,5 +1,5 @@
 /* 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()
@@ -11,13 +11,13 @@ 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)
index 54a1533266e379d0cb941c3cc0c4376d0d1faf62..ef8d99567f86dd9a7c4ed8d6549145a2e0bd2687 100644 (file)
 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;
@@ -50,16 +51,13 @@ PHP_METHOD(com, __construct)
        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);
@@ -78,28 +76,28 @@ PHP_METHOD(com, __construct)
 
                /* 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);
                }
@@ -686,34 +684,35 @@ PHP_FUNCTION(com_create_guid)
 /* {{{ 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);
index 8323b0796b8b310ac90460a7c70bf830b46d0ee4..9b1edf9d38d23562ef3f48e8996f06203b90dbf1 100644 (file)
@@ -58,8 +58,7 @@ function com_get_active_object(string $progid, ?int $code_page = null): variant
 
 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 {}
@@ -75,8 +74,7 @@ class variant
 
 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
index aec8108d8893e4d4b7796e3b8c00ff954474f0c6..3e583c321108bd1de985dc5094de8a45dd8f8eab 100644 (file)
@@ -1,5 +1,5 @@
 /* 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)
@@ -92,7 +92,7 @@ ZEND_END_ARG_INFO()
 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)
@@ -118,7 +118,7 @@ ZEND_END_ARG_INFO()
 
 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()
index 5ae356cc4f2a6226c3a9e19d67bb70be537f5636..bcc722c12dd49381afc4731c478447092ca35b8f 100644 (file)
@@ -2,35 +2,24 @@
 
 /** @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 {}
index 72e4d7b35c5f0eef4887607a60fe2645803ce1ae..10d8ae9bf128b6ca2d46c0073ef64aebadbbba6a 100644 (file)
@@ -1,5 +1,5 @@
 /* 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)
index 4a304fea83ec37b707aa78f63b8197242a4457df..5c218ecf1b90f376120bf2212c6e6de5ec9a76dd 100644 (file)
@@ -3590,7 +3590,7 @@ static void zend_ffi_tags_cleanup(zend_ffi_dcl *dcl) /* {{{ */
 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;
@@ -3601,11 +3601,7 @@ ZEND_METHOD(FFI, new) /* {{{ */
 
        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)
@@ -3670,7 +3666,7 @@ ZEND_METHOD(FFI, new) /* {{{ */
 
                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)) {
index df2ffc53f1b429eb70817e208e49180c51b96c3d..67b083eb2d063b37eb9006c73b45fda9cbbb04e8 100644 (file)
@@ -10,8 +10,7 @@ final class FFI
 
     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 {}
index 7b1f809233a9c7c5246fa7da76dfa7adfc1e84b4..d35c7e898bfe64c8b83923398025d8857604bb4b 100644 (file)
@@ -1,5 +1,5 @@
 /* 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, "\"\"")
@@ -15,7 +15,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_scope, 0, 1, FFI, 1)
 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()
index bc09ae70a37c8c4cdb633b7eaec75328d791d605..5c8953549759b55e4bb0952be45c6476299c29c8 100644 (file)
@@ -50,11 +50,10 @@ class IntlCalendar
     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
index 99626bd19e42c68bd79a14f0fd9b77782d4b859f..f84bf761406777ef85572e7a9dd53ae61e0cb7a4 100644 (file)
@@ -1,5 +1,5 @@
 /* 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()
@@ -32,7 +32,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlCalendar_clear, 0, 0, 0)
 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()
 
index df3fc24c61ab2c06eb2aa5b97d13c6523bc148dd..ed27551d669760316b62f90aae2ea9bf24132724 100644 (file)
@@ -941,38 +941,35 @@ U_CFUNC PHP_FUNCTION(intlcal_set_skipped_wall_time_option)
 
 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",
@@ -980,7 +977,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
                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 "
@@ -1023,8 +1020,8 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
        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);
        }
 }
 
index cdb5aedb03c407781ca0dca67220be1af9a5be20..5d77e075554a5f7d9596694f56d04c541c0cda0b 100644 (file)
@@ -99,7 +99,7 @@ class IntlDateFormatter
     public function isLenient() {}
 
     /**
-     * @param array|int $value
+     * @param object|array|string|int|float $value
      * @return string|false
      * @alias datefmt_format
      */
index ae128d8bf9696d11dee388f7bbdc6805faf73e1a..d94c8860039068e948dcdf55c8b9574926040fff 100644 (file)
@@ -1,5 +1,5 @@
 /* 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)
index 29a053ab207f21dbb0ff44a81a5fdfa437efa56d..a076ebd705ca1a3c6f17398a54212c1aa230d6d1 100644 (file)
@@ -71,6 +71,16 @@ typedef struct _intl_data {
         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)) );                                          \
index 8cb198e7d678c67194933bcbd4f89678a986451f..bf5e631ba4b4fc3c3b03686d2926ce4575938014 100644 (file)
@@ -89,8 +89,7 @@ function intlcal_set_repeated_wall_time_option(IntlCalendar $calendar, int $wall
 
 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 {}
 
@@ -188,7 +187,7 @@ function datefmt_set_lenient(IntlDateFormatter $df, bool $lenient): void {}
 
 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 {}
 
 /**
@@ -227,7 +226,7 @@ function numfmt_parse_currency(NumberFormatter $fmt, string $value, &$currency,
 /** @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 {}
 
@@ -372,7 +371,7 @@ function intltz_count_equivalent_ids(string $zoneId): int|false {}
 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) {}
@@ -436,8 +435,7 @@ function transliterator_list_ids(): array|false {}
 
 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 {}
 
index d66163c1b5087aad57f72cea4ac1ce2641f113f7..cdead236438ed31d0ecc373411a4df95f8230d8d 100644 (file)
@@ -1,5 +1,5 @@
 /* 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")
@@ -162,7 +162,7 @@ ZEND_END_ARG_INFO()
 #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()
 
@@ -405,7 +405,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_numfmt_set_attribute, 0, 3, _IS_
        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()
@@ -763,7 +763,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_transliterator_create_inverse, 0,
 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")
index 5e6208bb73f15b3f90554c3a50b0786f1db7c2a2..da8c2c88d7a55cbdc13a25ea1e2e926c95ce89cd 100644 (file)
@@ -19,7 +19,7 @@ class IntlTimeZone
     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
      */
index b21975eed45311115c723896eb9ae419663d2f6d..ce14cdced3f33b80a4bc6080ca0bcebccda3fd86 100644 (file)
@@ -1,5 +1,5 @@
 /* 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()
index 5ec0e10b78e2da52a4a67bd01ae5a724a253eba4..faf61e4914580a1f83468c0d8ab02c20c8f296a8 100644 (file)
@@ -280,47 +280,41 @@ PHP_FUNCTION( transliterator_transliterate )
        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();
        }
 
@@ -329,7 +323,8 @@ PHP_FUNCTION( transliterator_transliterate )
                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 )) )
@@ -337,16 +332,16 @@ PHP_FUNCTION( transliterator_transliterate )
                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 */
 
@@ -424,6 +419,7 @@ cleanup:
                RETVAL_FALSE;
        }
 
+cleanup_object:
        zval_ptr_dtor( &tmp_object );
 }
 /* }}} */
index f73226bb53b1d702ca1766e4acfddd7f027e3549..5c964c16f828c89c5745b1363b87cb3f57984426 100644 (file)
@@ -2,39 +2,28 @@
 
 /** @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 {}
 
index 4ebacd5260fbe2a7540f9f3ac119dd45ed36b115..77638aa9a0e67afc23f43b20cc09670d06efbae0 100644 (file)
@@ -1,10 +1,10 @@
 /* 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()
 
@@ -13,7 +13,7 @@ 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()
@@ -23,7 +23,7 @@ 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")
index a35e34e098a2dde0b8e0b6cfd95fe420b960a0c5..2348abf048d86db6e75a54ccef81c2af0c2ccd61 100644 (file)
@@ -46,7 +46,7 @@ class PDO
     public function rollBack() {}
 
     /**
-     * @param mixed $value
+     * @param array|int $value
      * @return bool
      */
     public function setAttribute(int $attribute, $value) {}
index b5cf1d81d0e7866fcd5bc6889b42774ca0a65bd1..a3ab1994ed67d8b007d13acd156d1ae238cd034b 100644 (file)
@@ -1,5 +1,5 @@
 /* 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)
index d81097c164e82d65ea7666eef332c38f10525174..d0141ceb45eaf85380da8bba919e2ec7e564510e 100644 (file)
@@ -55,11 +55,8 @@ class PDOStatement implements IteratorAggregate
     /** @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) {}
index a819f6a91eae7487cdd04f14572a19e1909dc70b..c05606c6faac79039e66f33003f68fb0208ea30d 100644 (file)
@@ -1,5 +1,5 @@
 /* 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)
@@ -72,7 +72,7 @@ ZEND_END_ARG_INFO()
 
 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)
index d9b69f784f4d2802ae3868d55a55fcb2889de2b7..da6ab987edd5f1d6b4602fef1532dfcd13aa2c35 100644 (file)
@@ -127,11 +127,8 @@ class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess
     /** @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) {}
@@ -401,11 +398,10 @@ class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAcc
     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
index 95799bd48782282e7790a7bf54e1a58052acf0c2..e3963fe1a93e8f20d2f8bcd722e95a0ca39d054b 100644 (file)
@@ -1,5 +1,5 @@
 /* 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)
@@ -129,7 +129,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_setDefaultStub, 0, 0, 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)
@@ -360,9 +360,7 @@ ZEND_END_ARG_INFO()
 
 #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);
index 7cc7714d382ad3d64569749b7c86c8e72e203ce0..ab512c68d0deb6d636f65737e237618da916ecf9 100644 (file)
@@ -659,31 +659,17 @@ retry:
 * 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) {
@@ -701,14 +687,14 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
                        }
                }
                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) {
@@ -1091,7 +1077,9 @@ static int netsnmp_session_set_security(struct snmp_session *session, char *sec_
 */
 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;
@@ -1112,64 +1100,104 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
        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;
        }
 
index 06632b602dbc9affc31a554e0f5ea20cadb9d49b..72d42e34613ae7bf698e77d4de22e87310ef4573 100644 (file)
@@ -2,30 +2,22 @@
 
 /** @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 {}
 
@@ -38,43 +30,33 @@ function snmp_set_oid_output_format(int $oid_format): 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 {}
 
@@ -84,7 +66,7 @@ function snmp_read_mib(string $filename): 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() {}
@@ -92,31 +74,21 @@ class SNMP
     /** @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() {}
index b12f4f8a249b3fdd0b5c3addc83b69f53213fe08..8a734fd57369315f03256c7417ec889474b32f71 100644 (file)
@@ -1,12 +1,12 @@
 /* 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
@@ -20,11 +20,11 @@ ZEND_END_ARG_INFO()
 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)
@@ -62,9 +62,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_snmp3_get, 0, 8, MAY_BE_ARRAY|MA
        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
@@ -81,11 +81,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_snmp3_set, 0, 10, MAY_BE_ARRAY|M
        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)
@@ -103,8 +103,8 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP___construct, 0, 0, 3)
        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)
@@ -121,23 +121,23 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_setSecurity, 0, 0, 1)
 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()
index e307177feaf19d2abc0abac1ef5e4d0bb78d4bff..5beddc3391929027ec502a1eb973ece2578c1c2a 100644 (file)
@@ -1085,7 +1085,6 @@ static void spl_array_set_array(zval *object, spl_array_object *intern, zval *ar
                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) {
@@ -1175,7 +1174,7 @@ PHP_METHOD(ArrayObject, __construct)
                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();
        }
 
@@ -1203,7 +1202,7 @@ PHP_METHOD(ArrayIterator, __construct)
                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();
        }
 
@@ -1280,7 +1279,7 @@ PHP_METHOD(ArrayObject, exchangeArray)
        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();
        }
 
index 7b1ae02afc1c9412235caab642d5822ef46552d7..114f1b6e321edc19a934b1d83b3ee5442d2a3b69 100755 (executable)
@@ -4,39 +4,34 @@
 
 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() {}
@@ -50,29 +45,17 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Count
     /** @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() {}
@@ -95,11 +78,8 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Count
     /** @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) {}
@@ -113,44 +93,41 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Count
 
 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
@@ -177,32 +154,28 @@ class ArrayIterator implements SeekableIterator, ArrayAccess, Serializable, Coun
     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
index 5d0b1f3943a52ab00c951423fa94dafeacce1cfa..1f5fdcc0614ad22337d4aa4f3208e914b839356b 100644 (file)
@@ -1,8 +1,8 @@
 /* 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()
@@ -15,13 +15,13 @@ 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)
@@ -36,13 +36,13 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject_setFlags, 0, 0, 1)
 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
@@ -66,7 +66,7 @@ ZEND_END_ARG_INFO()
 #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)
@@ -78,7 +78,7 @@ ZEND_END_ARG_INFO()
 #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()
 
index 1d91eceb6abd636f2a65c3ba53439c8cfbc338c4..9d066ecf13216fa75877ddb8456d692e14d1c214 100644 (file)
@@ -722,16 +722,14 @@ PHP_METHOD(SplDoublyLinkedList, getIteratorMode)
 /* {{{ 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);
 } /* }}} */
@@ -739,58 +737,53 @@ PHP_METHOD(SplDoublyLinkedList, offsetExists)
 /* {{{ 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();
                }
 
@@ -813,7 +806,7 @@ PHP_METHOD(SplDoublyLinkedList, offsetSet)
                        }
                } 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();
                }
        }
@@ -822,22 +815,20 @@ PHP_METHOD(SplDoublyLinkedList, offsetSet)
 /* {{{ 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();
        }
 
@@ -878,7 +869,7 @@ PHP_METHOD(SplDoublyLinkedList, offsetUnset)
 
                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();
        }
 } /* }}} */
@@ -1073,9 +1064,7 @@ PHP_METHOD(SplDoublyLinkedList, current)
        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);
        }
 }
 /* }}} */
@@ -1243,20 +1232,19 @@ PHP_METHOD(SplDoublyLinkedList, __unserialize) {
 /* {{{ 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();
        }
 
index 3cda7de01f6794d714f5b07ae682db89bd0ff8ca..176aa1584858110d892e73314c79a92350e70e29 100755 (executable)
@@ -4,12 +4,8 @@
 
 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() {}
@@ -17,17 +13,11 @@ class SplDoublyLinkedList implements Iterator, Countable, ArrayAccess, Serializa
     /** @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() {}
@@ -57,20 +47,19 @@ class SplDoublyLinkedList implements Iterator, Countable, ArrayAccess, Serializa
     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) {}
@@ -109,11 +98,10 @@ class SplDoublyLinkedList implements Iterator, Countable, ArrayAccess, Serializa
 class SplQueue extends SplDoublyLinkedList
 {
     /**
-     * @param mixed $value
      * @return void
      * @alias SplDoublyLinkedList::push
      */
-    public function enqueue($value) {}
+    public function enqueue(mixed $value) {}
 
     /**
      * @return mixed
index 70435e7e90109fc789c37d899ccda883c47bcb8c..4ad6e4db5574adf754d98c02de67f54bcf0f3abd 100644 (file)
@@ -1,9 +1,9 @@
 /* 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)
@@ -12,7 +12,7 @@ ZEND_END_ARG_INFO()
 #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
@@ -39,7 +39,10 @@ ZEND_END_ARG_INFO()
 
 #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
 
index d571524db26bc2850b0a815a6fd0b46109f99e6d..553de5c2faf35f83c10d96418262a13320a4b890 100755 (executable)
@@ -25,23 +25,22 @@ class SplFixedArray implements Iterator, ArrayAccess, Countable
     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
index 056b8119df06abe5889437085ed67161c8262eee..899202683e82c52e8c320753cd8b3b7b02a52fc3 100644 (file)
@@ -1,5 +1,5 @@
 /* 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")
@@ -31,7 +31,7 @@ ZEND_END_ARG_INFO()
 
 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
index 5642d784e6db4f9ab72f8ed3e90ea1b1e81f84d4..49f67af85dc4bea8b3dff2347e7242fff8e559c1 100644 (file)
@@ -4,19 +4,11 @@
 
 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) {}
@@ -90,11 +82,8 @@ abstract class SplHeap implements Iterator, Countable
     /** @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() {}
@@ -123,12 +112,8 @@ abstract class SplHeap implements Iterator, Countable
     /** @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() {}
@@ -139,20 +124,12 @@ abstract class SplHeap implements Iterator, Countable
 
 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) {}
 }
index 0febb0fea786e9bf27752fb617e79e23a6eb97dd..f68961ffbb2609b2b1c082063afaa30646e57940 100644 (file)
@@ -1,14 +1,14 @@
 /* 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)
@@ -45,7 +45,7 @@ ZEND_END_ARG_INFO()
 #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
@@ -67,8 +67,8 @@ ZEND_END_ARG_INFO()
 #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
index fa97f45b62a3d5716546e3166a8b20ee8715dd3e..cda92886687ce3ce2eccf84489945e95119d4027 100644 (file)
@@ -53,7 +53,6 @@ interface RecursiveIterator extends Iterator
 
 class RecursiveIteratorIterator implements OuterIterator
 {
-    /** @param Traversable $iterator */
     public function __construct(Traversable $iterator, int $mode = self::LEAVES_ONLY, int $flags = 0) {}
 
     /** @return void */
@@ -232,10 +231,9 @@ class CachingIterator extends IteratorIterator implements ArrayAccess, Countable
 
     /**
      * @param string $index
-     * @param mixed $value
      * @return void
      */
-    public function offsetSet($index, $value) {}
+    public function offsetSet($index, mixed $value) {}
 
     /**
      * @param string $index
index 66d4382cbed9aab6d0123db5d456f0dee0cc28a6..58f414a16c307f5c7bb81744566b007594cd8fd6 100644 (file)
@@ -1,5 +1,5 @@
 /* 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()
@@ -165,7 +165,7 @@ 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
index f3f4aab843a4e1d3866cc7b7a4ed998ff57cb084..e399b13c988088c29a94bc9556ce33f016c6eba5 100644 (file)
@@ -22,11 +22,8 @@ interface SplSubject
 
 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) {}
@@ -46,11 +43,8 @@ class SplObjectStorage implements Countable, Iterator, Serializable, ArrayAccess
     /** @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) {}
@@ -91,11 +85,10 @@ class SplObjectStorage implements Countable, Iterator, Serializable, ArrayAccess
 
     /**
      * @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
@@ -128,7 +121,6 @@ class MultipleIterator implements Iterator
     public function setFlags(int $flags) {}
 
     /**
-    * @param Iterator $iterator
     * @param int|string|null $info
     * @return void
     */
index 4d7b2b1ddeceaad857318f11647ea21eb1b6c961..3c08a442685536f4f989538ecc3f6ed741e5e35b 100644 (file)
@@ -1,5 +1,5 @@
 /* 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)
@@ -16,7 +16,7 @@ ZEND_END_ARG_INFO()
 
 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)
@@ -36,7 +36,7 @@ ZEND_END_ARG_INFO()
 #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)
@@ -67,7 +67,7 @@ ZEND_END_ARG_INFO()
 
 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
index 401d8ae1b3a7ac0bb162d8c2084c016af55cb1ff..347450fbe4b54a56eacc7039b97d00ef5e97ec44 100644 (file)
@@ -10,4 +10,4 @@ try {
 }
 ?>
 --EXPECT--
-Exception: Offset invalid or out of range
+Exception: SplDoublyLinkedList::add(): Argument #1 ($index) is out of range
index f8c58d9c705bac087fdbb5cf4b54f43c2e5ce1e9..1872436cea63086a51c1ce066608d5f7e08da505 100644 (file)
@@ -4,10 +4,10 @@ Check that SplDoublyLinkedList::add throws an exception with an invalid offset a
 <?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
index b6debb109bd168821ab1d324ce766fc565cf97f0..eb88027f5e9dc473a12f655a932bae56b9381480 100644 (file)
@@ -11,7 +11,7 @@ $get = $array->offsetGet( array( 'fail' ) );
 
 ?>
 --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}
index 43ce18c5c5ba5b9dfdcacea3220e0f44bd5f02f1..421d12ddbb0060e19acf58f36ca4cbddd519a14f 100644 (file)
@@ -11,7 +11,7 @@ $get = $array->offsetGet( 'fail' );
 
 ?>
 --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}
index 2512e23e78277cb63b552db7fed30a245a277523..4fa65b3a53addc5e2259eae1fe33a9b3d94dc3dd 100644 (file)
@@ -22,4 +22,4 @@ echo $e->getMessage();
 
 ?>
 --EXPECT--
-Offset out of range
+SplDoublyLinkedList::offsetUnset(): Argument #1 ($index) is out of range
index 364eb5ca79a6c473bf591c596f7f90ed24631a82..614ebdf01bbbb349932cee21556e5e2731336e9e 100644 (file)
@@ -20,4 +20,4 @@ PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com )
     }
 ?>
 --EXPECT--
-Offset out of range
+SplDoublyLinkedList::offsetUnset(): Argument #1 ($index) is out of range
index 5ba7b27e56bf96b31475676ea6d0ae73b56d88ce..6782bd948983530f295b90ac3a47b47137123597 100644 (file)
@@ -20,4 +20,4 @@ PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com )
     }
 ?>
 --EXPECT--
-Offset out of range
+SplDoublyLinkedList::offsetUnset(): Argument #1 ($index) is out of range
index d05a635500f2d27921f2f1a5333d0a096ce8da8c..8eea9c96fd759a392daf7c20b915e87d11f09d81 100644 (file)
@@ -42,8 +42,8 @@ $ao = new ArrayObject($original);
 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);
@@ -103,7 +103,7 @@ NULL
 
 
 --> 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) {
index 8829aa64febd641cd5c5c1bc76ea99bb2e23e0b6..e6623dd2fc704ef1cd24cccf5e13d287786b9705 100644 (file)
@@ -8,7 +8,7 @@ echo (new ReflectionMethod('ArrayIterator', '__construct'));
 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 ]
   }
 }
index fd89cade786e9fc491144a4ad419fd6630ef472d..7063aaab5aadffbf4c7769918a733ff8ab130a05 100644 (file)
@@ -10,4 +10,4 @@ $var_1->offsetSet(100,new DateTime('2000-01-01'));
 }
 ?>
 --EXPECT--
-Offset invalid or out of range
+SplDoublyLinkedList::offsetSet(): Argument #1 ($index) is out of range
index 88190573e485b12793ec376125acfb07b4db52d4..25b8bf330885065f5b624839e843f69fcba24573 100644 (file)
@@ -29,7 +29,7 @@ try {
 
 try {
     var_dump($a["a"]);
-} catch (OutOfRangeException $e) {
+} catch (TypeError $e) {
     echo "Exception: ".$e->getMessage()."\n";
 }
 
@@ -54,6 +54,6 @@ Unsetting..
 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
index 49b89d39a8b5496c92b84292dadac8c646d2983c..8bcc5e588449d8b28a3b40ce3e931ae5bc56681f 100644 (file)
@@ -31,7 +31,7 @@ echo $dll->pop()."\n";
 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
index e14acd12daacdde5c464dcc0aaa171d672419bc8..8a0d1cd735be8f356fcaffac170b593e15533b9b 100644 (file)
@@ -15,16 +15,16 @@ $test->next();
 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]=>
@@ -33,5 +33,5 @@ var_dump($output);
   int(9)
 }
 int(7)
-invalid argument exception
+ArrayIterator::__construct(): Argument #1 ($array) must be of type array, int given
 NULL
index 92c88ceaf154434eed62570dfa81d7d3b4c1b7de..0adb122ff5bb1590c582d9518af75f7bccc002cf 100644 (file)
        }       \
        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) \
        { \
@@ -336,22 +333,31 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
        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;
        }
 
@@ -376,9 +382,7 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
 
        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) {
@@ -986,13 +990,16 @@ PHP_FUNCTION(tidy_parse_string)
 {
        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");
@@ -1002,7 +1009,7 @@ PHP_FUNCTION(tidy_parse_string)
        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);
@@ -1044,15 +1051,18 @@ PHP_FUNCTION(tidy_parse_file)
        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);
@@ -1067,7 +1077,7 @@ PHP_FUNCTION(tidy_parse_file)
                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);
@@ -1335,17 +1345,19 @@ PHP_METHOD(tidy, __construct)
        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) {
@@ -1359,7 +1371,7 @@ PHP_METHOD(tidy, __construct)
                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);
 
@@ -1372,19 +1384,21 @@ PHP_METHOD(tidy, parseFile)
        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;
@@ -1395,7 +1409,7 @@ PHP_METHOD(tidy, parseFile)
        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;
@@ -1410,24 +1424,26 @@ PHP_METHOD(tidy, parseString)
 {
        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;
index fbb11adb9362aa6da6f9fbc9d0335d4a0a165c5b..76f4525132cc028a88daae5375e2efc83007b56d 100644 (file)
@@ -2,23 +2,19 @@
 
 /** @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 {}
 
@@ -58,8 +54,7 @@ function tidy_get_body(tidy $tidy): ?tidyNode {}
 
 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
@@ -73,31 +68,23 @@ class tidy
      */
     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
index aa845fdedb01e6f616859eecaa928b0dae077335..30ca646812494078d831a64ee9a50f2fd91493f8 100644 (file)
@@ -1,9 +1,9 @@
 /* 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()
 
@@ -17,7 +17,7 @@ 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()
@@ -28,13 +28,13 @@ 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()
@@ -91,8 +91,8 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_tidy_get_body, 0, 1, tidyNode, 1)
 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()
@@ -106,26 +106,26 @@ 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()