diff --git a/dictionaries/CallMap.php b/dictionaries/CallMap.php index 25f970de56f..e4695f2c742 100644 --- a/dictionaries/CallMap.php +++ b/dictionaries/CallMap.php @@ -1542,11 +1542,8 @@ 'Couchbase\zlibCompress' => ['string', 'data'=>'string'], 'Couchbase\zlibDecompress' => ['string', 'data'=>'string'], 'count' => ['int', 'value'=>'Countable|array|SimpleXMLElement|ResourceBundle', 'mode='=>'int'], -'count_chars' => ['array', 'input'=>'string', 'mode='=>'0'], -'count_chars\'1' => ['array', 'input'=>'string', 'mode='=>'1'], -'count_chars\'2' => ['array', 'input'=>'string', 'mode='=>'2'], -'count_chars\'3' => ['string', 'input'=>'string', 'mode='=>'3'], -'count_chars\'4' => ['string', 'input'=>'string', 'mode='=>'4'], +'count_chars' => ['array', 'input'=>'string', 'mode='=>'0|1|2'], +'count_chars\'1' => ['string', 'input'=>'string', 'mode='=>'3|4'], 'Countable::count' => ['int'], 'crack_check' => ['bool', 'dictionary'=>'', 'password'=>'string'], 'crack_closedict' => ['bool', 'dictionary='=>'resource'], diff --git a/dictionaries/CallMap_80_delta.php b/dictionaries/CallMap_80_delta.php index 583bff4a0d2..9402f8b84a2 100644 --- a/dictionaries/CallMap_80_delta.php +++ b/dictionaries/CallMap_80_delta.php @@ -174,24 +174,12 @@ 'new' => ['bool', 'typelib_name'=>'string', 'case_insensitive='=>'true'], ], 'count_chars' => [ - 'old' => ['array|false', 'input'=>'string', 'mode='=>'0'], - 'new' => ['array', 'input'=>'string', 'mode='=>'0'], + 'old' => ['array|false', 'input'=>'string', 'mode='=>'0|1|2'], + 'new' => ['array', 'input'=>'string', 'mode='=>'0|1|2'], ], 'count_chars\'1' => [ - 'old' => ['array|false', 'input'=>'string', 'mode='=>'1'], - 'new' => ['array', 'input'=>'string', 'mode='=>'1'], - ], - 'count_chars\'2' => [ - 'old' => ['array|false', 'input'=>'string', 'mode='=>'2'], - 'new' => ['array', 'input'=>'string', 'mode='=>'2'], - ], - 'count_chars\'3' => [ - 'old' => ['string|false', 'input'=>'string', 'mode='=>'3'], - 'new' => ['string', 'input'=>'string', 'mode='=>'3'], - ], - 'count_chars\'4' => [ - 'old' => ['string|false', 'input'=>'string', 'mode='=>'4'], - 'new' => ['string', 'input'=>'string', 'mode='=>'4'], + 'old' => ['string|false', 'input'=>'string', 'mode='=>'3|4'], + 'new' => ['string', 'input'=>'string', 'mode='=>'3|4'], ], 'curl_close' => [ 'old' => ['void', 'ch'=>'resource'], diff --git a/dictionaries/CallMap_historical.php b/dictionaries/CallMap_historical.php index 5e2786084f8..c69ed589017 100644 --- a/dictionaries/CallMap_historical.php +++ b/dictionaries/CallMap_historical.php @@ -10000,11 +10000,8 @@ 'cos' => ['float', 'num'=>'float'], 'cosh' => ['float', 'num'=>'float'], 'count' => ['int', 'value'=>'Countable|array|SimpleXMLElement|ResourceBundle', 'mode='=>'int'], - 'count_chars' => ['array|false', 'input'=>'string', 'mode='=>'0'], - 'count_chars\'1' => ['array|false', 'input'=>'string', 'mode='=>'1'], - 'count_chars\'2' => ['array|false', 'input'=>'string', 'mode='=>'2'], - 'count_chars\'3' => ['string|false', 'input'=>'string', 'mode='=>'3'], - 'count_chars\'4' => ['string|false', 'input'=>'string', 'mode='=>'4'], + 'count_chars' => ['array|false', 'input'=>'string', 'mode='=>'0|1|2'], + 'count_chars\'1' => ['string|false', 'input'=>'string', 'mode='=>'3|4'], 'crack_check' => ['bool', 'dictionary'=>'', 'password'=>'string'], 'crack_closedict' => ['bool', 'dictionary='=>'resource'], 'crack_getlastmessage' => ['string'], diff --git a/tests/FunctionCallTest.php b/tests/FunctionCallTest.php index 1197d861e04..2b425b3ec75 100644 --- a/tests/FunctionCallTest.php +++ b/tests/FunctionCallTest.php @@ -1747,6 +1747,24 @@ function sayHello(string $needle): void { [], '8.1', ], + 'count_charsProducesArrayOrString' => [ + ' [ + '$a===' => 'array', + '$b===' => 'array', + '$c===' => 'array', + '$d===' => 'string', + '$e===' => 'string', + ], + [], + '8.1', + ], ]; } @@ -2284,6 +2302,13 @@ function takesAString(string $s): void{ echo get_class();', 'error_message' => 'TooFewArguments', ], + 'count_charsWithInvalidMode' => [ + ' 'ArgumentTypeCoercion', + ], ]; }