Skip to content

Fix more PHP 7.4 errors#5156

Merged
staabm merged 1 commit intophpstan:2.1.xfrom
staabm:74more
Mar 9, 2026
Merged

Fix more PHP 7.4 errors#5156
staabm merged 1 commit intophpstan:2.1.xfrom
staabm:74more

Conversation

@staabm
Copy link
Copy Markdown
Contributor

@staabm staabm commented Mar 9, 2026

after this PR 2 errors are left:

1) PHPStan\Analyser\NodeScopeResolverTest::testFile with data set "tests\PHPStan\Analyser\nsrt\range-function.php" ('D:\a\phpstan-src\phpstan-src\...on.php')
Failed assertions in D:\a\phpstan-src\phpstan-src\tests\PHPStan\Analyser\nsrt\range-function.php:

Line 17:
Expected: array{2, 3, 4, 5}
Actual:   array{2.0, 3.0, 4.0, 5.0}

D:\a\phpstan-src\phpstan-src\tests\PHPStan\Analyser\NodeScopeResolverTest.php:320
D:\a\phpstan-src\phpstan-src\tests\vendor\phpunit\phpunit\src\TextUI\Command.php:146

this seems to be a recent regression


2) PHPStan\Analyser\NodeScopeResolverTest::testFile with data set "tests\PHPStan\Analyser\nsrt\properties.php" ('D:\a\phpstan-src\phpstan-src\...es.php')
Failed assertions in D:\a\phpstan-src\phpstan-src\tests\PHPStan\Analyser\nsrt\properties.php:

Line 169:
Expected: DOMElement|null
Actual:   string

I wonder why this test does not fail starting with PHP 8.2+ - not sure whether its expected or not

@staabm staabm requested a review from VincentLanglet March 9, 2026 08:50
@staabm staabm merged commit 6e91a8c into phpstan:2.1.x Mar 9, 2026
367 of 376 checks passed
@staabm staabm deleted the 74more branch March 9, 2026 09:00
@staabm
Copy link
Copy Markdown
Contributor Author

staabm commented Mar 9, 2026

@ondrejmirtes the remaining 2 errors (see PR description) seem to be related to the latest refactorings.

could you double check whether the tests just need to be adjusted or whether the changes introduced a bug?

phpstan-bot pushed a commit to phpstan-bot/phpstan-src that referenced this pull request Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants