diff --git a/resources/functionMap_php80delta.php b/resources/functionMap_php80delta.php index e17864ac5c..bba7c29015 100644 --- a/resources/functionMap_php80delta.php +++ b/resources/functionMap_php80delta.php @@ -193,6 +193,7 @@ 'imagejpeg\'1' => ['string|false', 'im'=>'resource', 'filename='=>'null', 'quality='=>'int'], 'imagerotate' => ['resource|false', 'src_im'=>'resource', 'angle'=>'float', 'bgdcolor'=>'int', 'ignoretransparent='=>'int'], 'imagescale' => ['resource|false', 'im'=>'resource', 'new_width'=>'int', 'new_height='=>'int', 'method='=>'int'], + 'implode\'1' => ['string', 'pieces'=>'array'], 'jpeg2wbmp' => ['bool', 'jpegname'=>'string', 'wbmpname'=>'string', 'dest_height'=>'int', 'dest_width'=>'int', 'threshold'=>'int'], 'ldap_sort' => ['bool', 'link_identifier'=>'resource', 'result_identifier'=>'resource', 'sortfilter'=>'string'], 'mb_decode_numericentity' => ['string|false', 'string'=>'string', 'convmap'=>'array', 'encoding='=>'string', 'is_hex='=>'bool'], diff --git a/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php b/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php index 6ca8c091c2..1d673de6c9 100644 --- a/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php +++ b/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php @@ -313,6 +313,14 @@ public function testImplodeOnPhp74(): void if (PHP_VERSION_ID < 70400) { $errors = []; } + if (PHP_VERSION_ID >= 80000) { + $errors = [ + [ + 'Parameter #2 $array of function implode expects array, string given.', + 8, + ], + ]; + } $this->analyse([__DIR__ . '/data/implode-74.php'], $errors); } diff --git a/tests/PHPStan/Rules/Functions/data/number-format-named-arguments.php b/tests/PHPStan/Rules/Functions/data/number-format-named-arguments.php index 866c4b34ab..fea39c2ad1 100644 --- a/tests/PHPStan/Rules/Functions/data/number-format-named-arguments.php +++ b/tests/PHPStan/Rules/Functions/data/number-format-named-arguments.php @@ -1,3 +1,5 @@ = 8.0 \number_format(200.00, decimals: 2, decimal_separator: ',', thousands_separator: ' '); + +$name = implode(separator: ' ', array: ['John', 'Doe']);