You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that, when using PHP 8.3, phan wasn't able to recognize callables using the __CLASS__ constant, like [ __CLASS__, 'methodName' ]. Upon digging a bit, I noticed that the AST generated by php-ast is different, in that the AST_MAGIC_CONST node no longer has the MAGIC_CLASS flag:
Therefore, phan can no longer recognize the __CLASS__ constant, which leads to a number of issues such as not resolving callables that use it.
Some more information:
$ php8.3 --versionPHP 8.3.3-1+ubuntu22.04.1+deb.sury.org+1 (cli) (built: Feb 15 2024 18:38:52) (NTS)Copyright (c) The PHP GroupZend Engine v4.3.3, Copyright (c) Zend Technologies with Zend OPcache v8.3.3-1+ubuntu22.04.1+deb.sury.org+1, Copyright (c), by Zend Technologies
$ php8.3 -r "echo phpversion('ast');"1.1.1
I first spotted this notice in a continuous integration environment a month ago, but I couldn't reproduce it locally with my version of PHP 8.3. While I can't be 100% sure, I likely had 8.3.2 at the time (or 8.3.1 at most), so it might be a regression in PHP 8.3.3.
Finally, note that this still works fine when using the polyfill parser:
I noticed that, when using PHP 8.3, phan wasn't able to recognize callables using the
__CLASS__
constant, like[ __CLASS__, 'methodName' ]
. Upon digging a bit, I noticed that the AST generated by php-ast is different, in that theAST_MAGIC_CONST
node no longer has theMAGIC_CLASS
flag:Therefore, phan can no longer recognize the
__CLASS__
constant, which leads to a number of issues such as not resolving callables that use it.Some more information:
I first spotted this notice in a continuous integration environment a month ago, but I couldn't reproduce it locally with my version of PHP 8.3. While I can't be 100% sure, I likely had 8.3.2 at the time (or 8.3.1 at most), so it might be a regression in PHP 8.3.3.
Finally, note that this still works fine when using the polyfill parser:
I don't know if this is a bug in php-ast or phan, but phan is affected nonetheless.
The text was updated successfully, but these errors were encountered: