diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b7b7084dedc..09da606d205 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -29,6 +29,7 @@ jobs: - "8.3" - "8.4" - "8.5" + - "8.6" steps: - name: Harden the runner (Audit all outbound calls) diff --git a/.github/workflows/phar.yml b/.github/workflows/phar.yml index 92d2f13a9bc..56396ef6804 100644 --- a/.github/workflows/phar.yml +++ b/.github/workflows/phar.yml @@ -1085,7 +1085,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4", "8.5"] + php-version: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4", "8.5", "8.6"] steps: - name: Harden the runner (Audit all outbound calls) diff --git a/.github/workflows/reflection-golden-test.yml b/.github/workflows/reflection-golden-test.yml index 577761982fb..0408433fb14 100644 --- a/.github/workflows/reflection-golden-test.yml +++ b/.github/workflows/reflection-golden-test.yml @@ -72,6 +72,7 @@ jobs: - "8.3" - "8.4" - "8.5" + - "8.6" steps: - name: Harden the runner (Audit all outbound calls) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index d5c74ba2b5b..2c35ca86165 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -35,6 +35,7 @@ jobs: - "8.3" - "8.4" - "8.5" + - "8.6" operating-system: [ubuntu-latest, windows-latest] steps: @@ -98,6 +99,7 @@ jobs: - "8.3" - "8.4" - "8.5" + - "8.6" steps: - name: Harden the runner (Audit all outbound calls) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1ba00dcffdc..43bbc64fd39 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,6 +35,7 @@ jobs: - "8.3" - "8.4" - "8.5" + - "8.6" operating-system: [ ubuntu-latest, windows-latest ] steps: diff --git a/conf/parametersSchema.neon b/conf/parametersSchema.neon index 5d968573089..8b6d821fe97 100644 --- a/conf/parametersSchema.neon +++ b/conf/parametersSchema.neon @@ -116,10 +116,10 @@ parametersSchema: loadLimit: schema(float(), nullable()) ]) phpVersion: schema(anyOf( - schema(int(), min(70100), max(80599)), + schema(int(), min(70100), max(80699)), structure([ - min: schema(int(), min(70100), max(80599)), - max: schema(int(), min(70100), max(80599)) + min: schema(int(), min(70100), max(80699)), + max: schema(int(), min(70100), max(80699)) ]) ), nullable()) polluteScopeWithLoopInitialAssignments: bool() diff --git a/e2e/composer-min-open-end-version/test.php b/e2e/composer-min-open-end-version/test.php index 9ed998185b8..794040a57f2 100644 --- a/e2e/composer-min-open-end-version/test.php +++ b/e2e/composer-min-open-end-version/test.php @@ -1,6 +1,6 @@ ', PHP_VERSION_ID); +\PHPStan\Testing\assertType('int<80100, 80699>', PHP_VERSION_ID); \PHPStan\Testing\assertType('8', PHP_MAJOR_VERSION); -\PHPStan\Testing\assertType('int<1, 5>', PHP_MINOR_VERSION); +\PHPStan\Testing\assertType('int<1, 6>', PHP_MINOR_VERSION); \PHPStan\Testing\assertType('int<0, max>', PHP_RELEASE_VERSION); diff --git a/e2e/composer-min-version/test.php b/e2e/composer-min-version/test.php index 9ed998185b8..794040a57f2 100644 --- a/e2e/composer-min-version/test.php +++ b/e2e/composer-min-version/test.php @@ -1,6 +1,6 @@ ', PHP_VERSION_ID); +\PHPStan\Testing\assertType('int<80100, 80699>', PHP_VERSION_ID); \PHPStan\Testing\assertType('8', PHP_MAJOR_VERSION); -\PHPStan\Testing\assertType('int<1, 5>', PHP_MINOR_VERSION); +\PHPStan\Testing\assertType('int<1, 6>', PHP_MINOR_VERSION); \PHPStan\Testing\assertType('int<0, max>', PHP_RELEASE_VERSION); diff --git a/e2e/composer-no-versions/test.php b/e2e/composer-no-versions/test.php index 3cae7a0628f..ff19dad613f 100644 --- a/e2e/composer-no-versions/test.php +++ b/e2e/composer-no-versions/test.php @@ -1,6 +1,6 @@ ', PHP_VERSION_ID); +\PHPStan\Testing\assertType('int<50207, 80699>', PHP_VERSION_ID); \PHPStan\Testing\assertType('int<5, 8>', PHP_MAJOR_VERSION); \PHPStan\Testing\assertType('int<0, max>', PHP_MINOR_VERSION); \PHPStan\Testing\assertType('int<0, max>', PHP_RELEASE_VERSION); diff --git a/src/Php/PhpVersionFactory.php b/src/Php/PhpVersionFactory.php index 73f510e0dca..3f7d455ed99 100644 --- a/src/Php/PhpVersionFactory.php +++ b/src/Php/PhpVersionFactory.php @@ -13,7 +13,7 @@ final class PhpVersionFactory { public const MIN_PHP_VERSION = 70100; - public const MAX_PHP_VERSION = 80599; + public const MAX_PHP_VERSION = 80699; public const MAX_PHP5_VERSION = 50699; public const MAX_PHP7_VERSION = 70499; diff --git a/tests/PHPStan/Analyser/ScopePhpVersionTest.php b/tests/PHPStan/Analyser/ScopePhpVersionTest.php index 193a55c53cf..0c68a2bc87b 100644 --- a/tests/PHPStan/Analyser/ScopePhpVersionTest.php +++ b/tests/PHPStan/Analyser/ScopePhpVersionTest.php @@ -15,11 +15,11 @@ public static function dataTestPhpVersion(): array { return [ [ - 'int<80000, 80599>', + 'int<80000, 80699>', __DIR__ . '/data/scope-constants-global.php', ], [ - 'int<80000, 80599>', + 'int<80000, 80699>', __DIR__ . '/data/scope-constants-namespace.php', ], ]; diff --git a/tests/PHPStan/Analyser/nsrt/filter-var-array-dynamic-php86.php b/tests/PHPStan/Analyser/nsrt/filter-var-array-dynamic-php86.php new file mode 100644 index 00000000000..2b219404a2a --- /dev/null +++ b/tests/PHPStan/Analyser/nsrt/filter-var-array-dynamic-php86.php @@ -0,0 +1,41 @@ += 8.6 + +namespace FilterVarArrayDynamicPhp86; + +use function PHPStan\Testing\assertType; + +/** + * @param array{exists: int, optional?: int, extra: int} $input + * @param array $arrayFilter + * @param FILTER_VALIDATE_* $intFilter + */ +function dynamicFilter(array $input, array $arrayFilter, int $intFilter): void +{ + // filter array with add_empty=default + assertType('array|false', filter_var_array($input, $arrayFilter)); + // filter array with add_empty=true + assertType('array|false', filter_var_array($input, $arrayFilter, true)); + // filter array with add_empty=false + assertType('array|false', filter_var_array($input, $arrayFilter, false)); + + // filter flag with add_empty=default + assertType('array|false', filter_var_array($input, $intFilter)); + // filter flag with add_empty=true + assertType('array|false', filter_var_array($input, $intFilter, true)); + // filter flag with add_empty=false + assertType('array|false', filter_var_array($input, $intFilter, false)); + + // filter array with add_empty=default + assertType('array|false', filter_var_array([], $arrayFilter)); + // filter array with add_empty=true + assertType('array|false', filter_var_array([], $arrayFilter, true)); + // filter array with add_empty=false + assertType('array|false', filter_var_array([], $arrayFilter, false)); + + // filter flag with add_empty=default + assertType('array|false', filter_var_array([], $intFilter)); + // filter flag with add_empty=true + assertType('array|false', filter_var_array([], $intFilter, true)); + // filter flag with add_empty=false + assertType('array|false', filter_var_array([], $intFilter, false)); +} diff --git a/tests/PHPStan/Analyser/nsrt/filter-var-array-dynamic.php b/tests/PHPStan/Analyser/nsrt/filter-var-array-dynamic.php new file mode 100644 index 00000000000..6546a97e806 --- /dev/null +++ b/tests/PHPStan/Analyser/nsrt/filter-var-array-dynamic.php @@ -0,0 +1,41 @@ + $arrayFilter + * @param FILTER_VALIDATE_* $intFilter + */ +function dynamicFilter(array $input, array $arrayFilter, int $intFilter): void +{ + // filter array with add_empty=default + assertType('array|false|null', filter_var_array($input, $arrayFilter)); + // filter array with add_empty=true + assertType('array|false|null', filter_var_array($input, $arrayFilter, true)); + // filter array with add_empty=false + assertType('array|false|null', filter_var_array($input, $arrayFilter, false)); + + // filter flag with add_empty=default + assertType('array|false|null', filter_var_array($input, $intFilter)); + // filter flag with add_empty=true + assertType('array|false|null', filter_var_array($input, $intFilter, true)); + // filter flag with add_empty=false + assertType('array|false|null', filter_var_array($input, $intFilter, false)); + + // filter array with add_empty=default + assertType('array|false|null', filter_var_array([], $arrayFilter)); + // filter array with add_empty=true + assertType('array|false|null', filter_var_array([], $arrayFilter, true)); + // filter array with add_empty=false + assertType('array|false|null', filter_var_array([], $arrayFilter, false)); + + // filter flag with add_empty=default + assertType('array|false|null', filter_var_array([], $intFilter)); + // filter flag with add_empty=true + assertType('array|false|null', filter_var_array([], $intFilter, true)); + // filter flag with add_empty=false + assertType('array|false|null', filter_var_array([], $intFilter, false)); +} diff --git a/tests/PHPStan/Analyser/nsrt/filter-var-array.php b/tests/PHPStan/Analyser/nsrt/filter-var-array.php index 1151d370c12..5e712a96b1e 100644 --- a/tests/PHPStan/Analyser/nsrt/filter-var-array.php +++ b/tests/PHPStan/Analyser/nsrt/filter-var-array.php @@ -302,39 +302,3 @@ function dynamicVariables(array $input): void 'missing' => $filter, ], false)); } - -/** - * @param array{exists: int, optional?: int, extra: int} $input - * @param array $arrayFilter - * @param FILTER_VALIDATE_* $intFilter - */ -function dynamicFilter(array $input, array $arrayFilter, int $intFilter): void -{ - // filter array with add_empty=default - assertType('array|false|null', filter_var_array($input, $arrayFilter)); - // filter array with add_empty=true - assertType('array|false|null', filter_var_array($input, $arrayFilter, true)); - // filter array with add_empty=false - assertType('array|false|null', filter_var_array($input, $arrayFilter, false)); - - // filter flag with add_empty=default - assertType('array|false|null', filter_var_array($input, $intFilter)); - // filter flag with add_empty=true - assertType('array|false|null', filter_var_array($input, $intFilter, true)); - // filter flag with add_empty=false - assertType('array|false|null', filter_var_array($input, $intFilter, false)); - - // filter array with add_empty=default - assertType('array|false|null', filter_var_array([], $arrayFilter)); - // filter array with add_empty=true - assertType('array|false|null', filter_var_array([], $arrayFilter, true)); - // filter array with add_empty=false - assertType('array|false|null', filter_var_array([], $arrayFilter, false)); - - // filter flag with add_empty=default - assertType('array|false|null', filter_var_array([], $intFilter)); - // filter flag with add_empty=true - assertType('array|false|null', filter_var_array([], $intFilter, true)); - // filter flag with add_empty=false - assertType('array|false|null', filter_var_array([], $intFilter, false)); -} diff --git a/tests/PHPStan/Analyser/nsrt/node-callback-scope.php b/tests/PHPStan/Analyser/nsrt/node-callback-scope.php index 85519a3c71c..01a88340dc9 100644 --- a/tests/PHPStan/Analyser/nsrt/node-callback-scope.php +++ b/tests/PHPStan/Analyser/nsrt/node-callback-scope.php @@ -479,7 +479,7 @@ function doFoo(): void { } function (): void { - assertType('int<50207, 80599>', PHP_VERSION_ID); + assertType('int<50207, 80699>', PHP_VERSION_ID); }; function (int $i) { diff --git a/tests/PHPStan/Analyser/nsrt/predefined-constants.php b/tests/PHPStan/Analyser/nsrt/predefined-constants.php index 7c38d3833b5..95961c5acaf 100644 --- a/tests/PHPStan/Analyser/nsrt/predefined-constants.php +++ b/tests/PHPStan/Analyser/nsrt/predefined-constants.php @@ -7,7 +7,7 @@ assertType('int<5, 8>', PHP_MAJOR_VERSION); assertType('int<0, max>', PHP_MINOR_VERSION); assertType('int<0, max>', PHP_RELEASE_VERSION); -assertType('int<50207, 80599>', PHP_VERSION_ID); +assertType('int<50207, 80699>', PHP_VERSION_ID); assertType('string', PHP_EXTRA_VERSION); assertType('0|1', PHP_ZTS); assertType('0|1', PHP_DEBUG); diff --git a/tests/PHPStan/Php/PhpVersionFactoryTest.php b/tests/PHPStan/Php/PhpVersionFactoryTest.php index 3687e60e075..ba7db2df2b1 100644 --- a/tests/PHPStan/Php/PhpVersionFactoryTest.php +++ b/tests/PHPStan/Php/PhpVersionFactoryTest.php @@ -93,8 +93,14 @@ public static function dataCreate(): array [ null, '8.6', - 80599, - '8.5.99', + 80600, + '8.6', + ], + [ + null, + '8.7', + 80699, + '8.6.99', ], ]; }