summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2019-11-08 23:29:12 +0100
committerMáté Kocsis <kocsismate@woohoolabs.com>2019-11-11 14:54:55 +0100
commit27e83d0fb87c04b61441fb77e963dd4e14ad187e (patch)
tree1b35b21c48c54f353e643d29dd2306d8e1ba084a /sapi
parent2804ea612779b89d3c62d974eb35783dd31f7dee (diff)
downloadphp-git-27e83d0fb87c04b61441fb77e963dd4e14ad187e.tar.gz
Add union return types for function stubs
Diffstat (limited to 'sapi')
-rw-r--r--sapi/cli/tests/006.phpt8
-rw-r--r--sapi/phpdbg/phpdbg.stub.php3
-rw-r--r--sapi/phpdbg/phpdbg_arginfo.h2
3 files changed, 10 insertions, 3 deletions
diff --git a/sapi/cli/tests/006.phpt b/sapi/cli/tests/006.phpt
index 4311d9b259..b1f756d17f 100644
--- a/sapi/cli/tests/006.phpt
+++ b/sapi/cli/tests/006.phpt
@@ -74,6 +74,7 @@ string(%d) "Extension [ <persistent> extension #%d pcre version %s ] {
Parameter #3 [ <optional> int $flags ]
Parameter #4 [ <optional> int $offset ]
}
+ - Return [ int|false ]
}
Function [ <internal:pcre> function preg_match_all ] {
@@ -84,6 +85,7 @@ string(%d) "Extension [ <persistent> extension #%d pcre version %s ] {
Parameter #3 [ <optional> int $flags ]
Parameter #4 [ <optional> int $offset ]
}
+ - Return [ int|false|null ]
}
Function [ <internal:pcre> function preg_replace ] {
@@ -94,6 +96,7 @@ string(%d) "Extension [ <persistent> extension #%d pcre version %s ] {
Parameter #3 [ <optional> int $limit ]
Parameter #4 [ <optional> &$count ]
}
+ - Return [ array|string|null ]
}
Function [ <internal:pcre> function preg_replace_callback ] {
@@ -105,6 +108,7 @@ string(%d) "Extension [ <persistent> extension #%d pcre version %s ] {
Parameter #4 [ <optional> &$count ]
Parameter #5 [ <optional> int $flags ]
}
+ - Return [ array|string|null ]
}
Function [ <internal:pcre> function preg_replace_callback_array ] {
@@ -115,6 +119,7 @@ string(%d) "Extension [ <persistent> extension #%d pcre version %s ] {
Parameter #3 [ <optional> &$count ]
Parameter #4 [ <optional> int $flags ]
}
+ - Return [ array|string|null ]
}
Function [ <internal:pcre> function preg_filter ] {
@@ -125,6 +130,7 @@ string(%d) "Extension [ <persistent> extension #%d pcre version %s ] {
Parameter #3 [ <optional> int $limit ]
Parameter #4 [ <optional> &$count ]
}
+ - Return [ array|string|null ]
}
Function [ <internal:pcre> function preg_split ] {
@@ -134,6 +140,7 @@ string(%d) "Extension [ <persistent> extension #%d pcre version %s ] {
Parameter #2 [ <optional> int $limit ]
Parameter #3 [ <optional> int $flags ]
}
+ - Return [ array|false ]
}
Function [ <internal:pcre> function preg_quote ] {
@@ -150,6 +157,7 @@ string(%d) "Extension [ <persistent> extension #%d pcre version %s ] {
Parameter #1 [ <required> array $input ]
Parameter #2 [ <optional> int $flags ]
}
+ - Return [ array|false ]
}
Function [ <internal:pcre> function preg_last_error ] {
diff --git a/sapi/phpdbg/phpdbg.stub.php b/sapi/phpdbg/phpdbg.stub.php
index cf6575de20..bcccc5f9d0 100644
--- a/sapi/phpdbg/phpdbg.stub.php
+++ b/sapi/phpdbg/phpdbg.stub.php
@@ -12,8 +12,7 @@ function phpdbg_color(int $element, string $color): void {}
function phpdbg_prompt(string $string): void {}
-/** @return string|bool */
-function phpdbg_exec(string $context) {}
+function phpdbg_exec(string $context): string|bool {}
function phpdbg_clear(): void {}
diff --git a/sapi/phpdbg/phpdbg_arginfo.h b/sapi/phpdbg/phpdbg_arginfo.h
index c59f6ecf0f..e130ebd33f 100644
--- a/sapi/phpdbg/phpdbg_arginfo.h
+++ b/sapi/phpdbg/phpdbg_arginfo.h
@@ -26,7 +26,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phpdbg_prompt, 0, 1, IS_VOID, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_phpdbg_exec, 0, 0, 1)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_phpdbg_exec, 0, 1, MAY_BE_STRING|MAY_BE_BOOL)
ZEND_ARG_TYPE_INFO(0, context, IS_STRING, 0)
ZEND_END_ARG_INFO()