diff --git a/tests/PHPStan/Analyser/NodeScopeResolverTest.php b/tests/PHPStan/Analyser/NodeScopeResolverTest.php index 574004643e..2c8a2befe6 100644 --- a/tests/PHPStan/Analyser/NodeScopeResolverTest.php +++ b/tests/PHPStan/Analyser/NodeScopeResolverTest.php @@ -191,6 +191,11 @@ public function dataFileAsserts(): iterable yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-1014.php'); yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-pr-339.php'); yield from $this->gatherAssertTypes(__DIR__ . '/data/pow.php'); + if (PHP_VERSION_ID >= 80000) { + yield from $this->gatherAssertTypes(__DIR__ . '/data/pow-php8.php'); + } else { + yield from $this->gatherAssertTypes(__DIR__ . '/data/pow-php7.php'); + } yield from $this->gatherAssertTypes(__DIR__ . '/data/throw-expr.php'); yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-5351.php'); diff --git a/tests/PHPStan/Analyser/data/pow-php7.php b/tests/PHPStan/Analyser/data/pow-php7.php new file mode 100644 index 0000000000..0e068ccabc --- /dev/null +++ b/tests/PHPStan/Analyser/data/pow-php7.php @@ -0,0 +1,8 @@ +