From 94fd52dd091051d4d4089c4c89b68fee6a876e23 Mon Sep 17 00:00:00 2001 From: Levi Morrison Date: Thu, 3 Sep 2020 07:03:12 -0600 Subject: Add Z_PARAM_ITERABLE and co --- ext/zend_test/test.c | 12 ++++++++++++ ext/zend_test/test.stub.php | 2 ++ ext/zend_test/test_arginfo.h | 9 ++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) (limited to 'ext/zend_test') diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c index 2d91543cf1..18e7443313 100644 --- a/ext/zend_test/test.c +++ b/ext/zend_test/test.c @@ -221,6 +221,18 @@ ZEND_FUNCTION(zend_string_or_stdclass_or_null) } /* }}} */ +/* TESTS Z_PARAM_ITERABLE and Z_PARAM_ITERABLE_OR_NULL */ +ZEND_FUNCTION(zend_iterable) +{ + zval *arg1, *arg2; + + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_ITERABLE(arg1) + Z_PARAM_OPTIONAL + Z_PARAM_ITERABLE_OR_NULL(arg2) + ZEND_PARSE_PARAMETERS_END(); +} + static zend_object *zend_test_class_new(zend_class_entry *class_type) /* {{{ */ { zend_object *obj = zend_objects_new(class_type); object_properties_init(obj, class_type); diff --git a/ext/zend_test/test.stub.php b/ext/zend_test/test.stub.php index cc4a561f54..1dd0cfec4e 100644 --- a/ext/zend_test/test.stub.php +++ b/ext/zend_test/test.stub.php @@ -39,3 +39,5 @@ function zend_string_or_stdclass($param): stdClass|string {} /** @param stdClass|string|null $param */ function zend_string_or_stdclass_or_null($param): stdClass|string|null {} + +function zend_iterable(iterable $arg1, ?iterable $arg2 = null): void {} diff --git a/ext/zend_test/test_arginfo.h b/ext/zend_test/test_arginfo.h index ae7cd77b58..bd8d477b42 100644 --- a/ext/zend_test/test_arginfo.h +++ b/ext/zend_test/test_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 82fd97d4985448884141842955a4bee2c90ba338 */ + * Stub hash: 87c9d71b08c538c28b4f9bad01d7a7a3a3b191ef */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_test_array_return, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() @@ -46,6 +46,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_zend_string_or_stdclass_or_n ZEND_ARG_INFO(0, param) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_iterable, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, arg1, IS_ITERABLE, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, arg2, IS_ITERABLE, 1, "null") +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class__ZendTestClass_is_object, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -68,6 +73,7 @@ ZEND_FUNCTION(zend_string_or_object); ZEND_FUNCTION(zend_string_or_object_or_null); ZEND_FUNCTION(zend_string_or_stdclass); ZEND_FUNCTION(zend_string_or_stdclass_or_null); +ZEND_FUNCTION(zend_iterable); ZEND_METHOD(_ZendTestClass, is_object); ZEND_METHOD(_ZendTestClass, __toString); ZEND_METHOD(_ZendTestTrait, testMethod); @@ -86,6 +92,7 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(zend_string_or_object_or_null, arginfo_zend_string_or_object_or_null) ZEND_FE(zend_string_or_stdclass, arginfo_zend_string_or_stdclass) ZEND_FE(zend_string_or_stdclass_or_null, arginfo_zend_string_or_stdclass_or_null) + ZEND_FE(zend_iterable, arginfo_zend_iterable) ZEND_FE_END }; -- cgit v1.2.1