-
-
Notifications
You must be signed in to change notification settings - Fork 946
Open
phpstan/phpstan-src
#4863Labels
Description
Feature request
In phpstan/phpstan-src#3642 we added php version dependent narrowing for conditions checking PHP_VERSION_ID, like e.g. if (PHP_VERSION_ID >= 80000) {}.
there are more conditions which narrow the php version which could re-use the implemented logic to narrow the php-version in Scope. examples are
version_compare( PHP_VERSION, '8.4', '<' )version_compare( PHP_VERSION, '8.4' ) === 1
maybe we can just re-write the AST in case version_compare is invoked with PHP_VERSION in one of the 2 version parameters?
https://phpstan.org/r/1eab8f33-e339-4c4a-addc-f1274d5d06a4
Reactions are currently unavailable