summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinem0o <cuneaz.leo@gmail.com>2019-08-10 15:54:43 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-08-10 17:40:10 +0200
commitb98bc5bd9216be9d2ee47d251630d069d30e129d (patch)
treeb53eb2a6ef94cdd32713630ba724ce7db7f2c52d
parent7e7eaa0eb23fd67202ca669ff1b9e66993ba797a (diff)
downloadphp-git-b98bc5bd9216be9d2ee47d251630d069d30e129d.tar.gz
Add base64_encode / base64_decode stubs
Closes GH-4504.
-rw-r--r--ext/standard/basic_functions.c11
-rw-r--r--ext/standard/basic_functions.stub.php7
-rw-r--r--ext/standard/basic_functions_arginfo.h9
3 files changed, 16 insertions, 11 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index f7490211b3..d1ac708795 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -761,17 +761,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_assert_options, 0, 0, 1)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
/* }}} */
-/* {{{ base64.c */
-ZEND_BEGIN_ARG_INFO(arginfo_base64_encode, 0)
- ZEND_ARG_INFO(0, str)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_base64_decode, 0, 0, 1)
- ZEND_ARG_INFO(0, str)
- ZEND_ARG_INFO(0, strict)
-ZEND_END_ARG_INFO()
-
-/* }}} */
/* {{{ browscap.c */
ZEND_BEGIN_ARG_INFO_EX(arginfo_get_browser, 0, 0, 0)
ZEND_ARG_INFO(0, browser_name)
diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php
index d071126922..ba7300e198 100644
--- a/ext/standard/basic_functions.stub.php
+++ b/ext/standard/basic_functions.stub.php
@@ -59,3 +59,10 @@ function stream_wrapper_restore(string $protocol): bool {}
/** @return int|false */
function array_push(array &$stack, ...$args) {}
+
+/* base64.c */
+
+function base64_encode(string $str): string {}
+
+/** @return string|false */
+function base64_decode(string $str, bool $strict = false) {}
diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h
index bc43829120..23b2dce733 100644
--- a/ext/standard/basic_functions_arginfo.h
+++ b/ext/standard/basic_functions_arginfo.h
@@ -69,3 +69,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_array_push, 0, 0, 1)
ZEND_ARG_TYPE_INFO(1, stack, IS_ARRAY, 0)
ZEND_ARG_VARIADIC_INFO(0, args)
ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_base64_encode, 0, 1, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_base64_decode, 0, 0, 1)
+ ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, strict, _IS_BOOL, 0)
+ZEND_END_ARG_INFO()