PHP Custom Extension

Hi. I have created a custom PHP extension ([whatever].so). I would like to ask what is the best way to provide annotation for it?

1 comment
Comment actions Permalink

Hi there,

You need to make a stub file in PHP. Stub is a .php file with your classes/functions/constants/etc written in PHP -- just declaration part only (empty bodies) + PHPDoc.

PhpStorm does the same for all standard PHP core stuff/other extensions.

You can Ctrl+Click on any PHP core class/function and IDE will take you to the appropriate stub file. You can also browse all that stuff online:


Please sign in to leave a comment.