What happens?:
While running some extensions with the new phan-config version 0.13.0 there was also the hint to replace empty() on properties of classes Parser or EditPage, both are marked with #[\AllowDynamicProperties] and the empty is used also for error suppression in that case.
It seems that the plugin (from T234237) running with php8.1 also treat this as "always set"
Examples reported by the plugin:
- https://gerrit.wikimedia.org/r/c/mediawiki/extensions/TemplateSandbox/+/967571
- https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Scribunto/+/967572 Found usage of empty() on expression $parser->scribunto_engine that appears to be always set. empty() should only be used to suppress errors. See https://w.wiki/6paE
What should have happened instead?:
Better not reporting this issues
Or are these expected false positives?
I have no php7.4 installed to test if the issue gets reported there as well.
Software version (skip for WMF-hosted wikis like Wikipedia):
Other information (browser name/version, screenshots, etc.):