Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Feb 9, 2026

if ($integerVersionRange !== null) {
$narrowedVersion = TypeCombinator::intersect($scope->getPhpVersion()->getType(), $integerVersionRange);
return $this->typeSpecifier->create(
new ConstFetch(new Name('\\PHP_VERSION_ID')),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel I am hitting a bug here, as depending on how I name the constant here
PHP_VERSION_ID vs. \\PHP_VERSION_ID the inference does not work as expected

(and it seems it depends on whether the code beeing analyzed is namespaced or not)

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.

narrow scope on version_compare( PHP_VERSION, '8.4', '<' )

1 participant