summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-09-25 12:31:05 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-09-25 12:31:05 +0200
commit43ce18f8373f2027a3173f4b99c0bd6b2609bd7a (patch)
tree2c784f98fae3d8193044cf4e2203d19323ee5b02
parent41b096b392e551df51c80d29f6f30c163a0630ea (diff)
downloadphp-git-43ce18f8373f2027a3173f4b99c0bd6b2609bd7a.tar.gz
Add proper count() parameter type
We can make this Countable|array now.
-rwxr-xr-xext/standard/basic_functions.stub.php10
-rw-r--r--ext/standard/basic_functions_arginfo.h4
2 files changed, 5 insertions, 9 deletions
diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php
index eea47c664f..ec0e056dac 100755
--- a/ext/standard/basic_functions.stub.php
+++ b/ext/standard/basic_functions.stub.php
@@ -62,14 +62,10 @@ function krsort(array &$array, int $flags = SORT_REGULAR): bool {}
function ksort(array &$array, int $flags = SORT_REGULAR): bool {}
-/** @param Countable|array $var */
-function count($var, int $mode = COUNT_NORMAL): int {}
+function count(Countable|array $var, int $mode = COUNT_NORMAL): int {}
-/**
- * @param Countable|array $var
- * @alias count
- */
-function sizeof($var, int $mode = COUNT_NORMAL): int {}
+/** @alias count */
+function sizeof(Countable|array $var, int $mode = COUNT_NORMAL): int {}
function natsort(array &$array): bool {}
diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h
index e044eef24e..5e19997bb4 100644
--- a/ext/standard/basic_functions_arginfo.h
+++ b/ext/standard/basic_functions_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 5275c2ba801f36ecf17e6b615b19373aca34e852 */
+ * Stub hash: 97187c073137b8fdfc03bdecf72377ef73d79290 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0)
@@ -82,7 +82,7 @@ ZEND_END_ARG_INFO()
#define arginfo_ksort arginfo_krsort
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_count, 0, 1, IS_LONG, 0)
- ZEND_ARG_INFO(0, var)
+ ZEND_ARG_OBJ_TYPE_MASK(0, var, Countable, MAY_BE_ARRAY, NULL)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "COUNT_NORMAL")
ZEND_END_ARG_INFO()