com php-src: Add test for void return type on internal function: Zend/tests/return_types/internal_functions003.phpt ext/zend_test/test.c
| From: | Nikita Popov | Date: | Sat, 30 Jun 2018 18:14:15 +0000 |
| Subject: | com php-src: Add test for void return type on internal function: Zend/tests/return_types/internal_functions003.phpt ext/zend_test/test.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-102346@lists.php.net to get a copy of this message | ||
Commit: 8faa6ef30e9e75764695dff4168902f5de7ebb1d
Author: Nikita Popov <nikita.ppv@gmail.com> Sat, 30 Jun 2018 20:14:15 +0200
Parents: 7909d4532c6ba2ee015aa9a5089e3c3199f660b3
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8faa6ef30e9e75764695dff4168902f5de7ebb1d
Log:
Add test for void return type on internal function
Changed paths:
A Zend/tests/return_types/internal_functions003.phpt
M ext/zend_test/test.c
Diff:
diff --git a/Zend/tests/return_types/internal_functions003.phpt
b/Zend/tests/return_types/internal_functions003.phpt
new file mode 100644
index 0000000..d2696a7
--- /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 41eae28..da83a9f 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)