diff options
| -rw-r--r-- | Zend/tests/return_types/internal_functions003.phpt | 11 | ||||
| -rw-r--r-- | ext/zend_test/test.c | 9 |
2 files changed, 20 insertions, 0 deletions
diff --git a/Zend/tests/return_types/internal_functions003.phpt b/Zend/tests/return_types/internal_functions003.phpt new file mode 100644 index 0000000000..d2696a78c1 --- /dev/null +++ b/Zend/tests/return_types/internal_functions003.phpt @@ -0,0 +1,11 @@ +--TEST-- +Return type for internal functions 3: Void return type +--SKIPIF-- +<?php +if (!function_exists('zend_test_void_return')) die('skip'); +--FILE-- +<?php +var_dump(zend_test_void_return()); +?> +--EXPECT-- +NULL diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c index 41eae280e5..da83a9fa1d 100644 --- a/ext/zend_test/test.c +++ b/ext/zend_test/test.c @@ -37,6 +37,9 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(arginfo_zend_test_nullable_array_return, IS_ARRAY, 1) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(arginfo_zend_test_void_return, IS_VOID, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_zend_terminate_string, 0, 0, 1) ZEND_ARG_INFO(1, str) ZEND_END_ARG_INFO() @@ -64,6 +67,11 @@ ZEND_FUNCTION(zend_test_nullable_array_return) zend_parse_parameters(ZEND_NUM_ARGS(), "|zz", &arg1, &arg2); } +ZEND_FUNCTION(zend_test_void_return) +{ + /* dummy */ +} + /* Create a string without terminating null byte. Must be termined with * zend_terminate_string() before destruction, otherwise a warning is issued * in debug builds. */ @@ -239,6 +247,7 @@ PHP_MINFO_FUNCTION(zend_test) static const zend_function_entry zend_test_functions[] = { ZEND_FE(zend_test_array_return, arginfo_zend_test_array_return) ZEND_FE(zend_test_nullable_array_return, arginfo_zend_test_nullable_array_return) + ZEND_FE(zend_test_void_return, arginfo_zend_test_void_return) ZEND_FE(zend_create_unterminated_string, NULL) ZEND_FE(zend_terminate_string, arginfo_zend_terminate_string) ZEND_FE(zend_leak_bytes, NULL) |
