Thanks Erick!
It makes sense for the formatter to check the PHP version and avoid adding a trailing comma in function parameter declarations when targeting PHP < 8.0, even if the addCommaAfterLastDeclParameter setting is enabled. We’ll look into improving this so the formatter becomes version-aware.
In the meantime, to prevent this behavior, you can explicitly disable the setting like this:
Option 1 – .editorconfig
[*.php]
php_format_add_comma_after_last_decl_parameter = false
Option 2 – settings.json
"php.format.rules.addCommaAfterLastDeclParameter": false
Thank you