What does @internal actually mean and how to use it?

This is PhpStorm bug. It should not strike @internal methods used inside of library/package.

So yes, your understand of meaning of @internal tag is correct - it is for mark public/protected methods as not a part of public API. You should ignore these warnings for usage inside of library.

Technically there is nothing that will stop you from using such methods even for 3rd party libraries, but you should be aware of consequences - there is no backward compatibility promise for them, so they can be changed, renamed or completely disappear without any warning.


I believe it is the comment for programmer about some specific usages. I mark my recommendations in which cases to use this function or alternative one (e.g. 'use this func in CLI mode only' or 'use this function only if you need row data. Pls consider wrapper in all other cases')

https://docs.phpdoc.org/latest/guide/references/phpdoc/tags/internal.html

@internal The @internal tag is used to denote that associated Structural Elements are elements internal to this application or library. It may also be used inside a long description to insert a piece of text that is only applicable for the developers of this software.