>> This is already fixed in GNU Emacs 31.
>
> I see! I actually tried to check this with a copy of php-ts-mode.el from
> the master branch before reporting
> and also copied in the new macro definition of
> `treesit-declare-unavailable-functions`
>
> I eval'ed the whole thing and still faced the same problem.
>
> I might be missing something else that is not obvious to me here.
> I'll try upgrading to emacs 31 completely in a few weeks to see if it works
> for me as well.
Unfortunately this is not as simple as using the new php-ts-mode.el.
You also need the new treesit.el and even treesit.c.