We call PhpStorm “an IDE that actually ‘gets’ your code,” meaning that it provides completion, type inference, inspection, documentation pop-ups, and a lot more coding assistance.
For all the Standard PHP Library components as well as for common extensions, this functionality is based on PHP stubs. Stubs are normal, syntactically correct PHP files that contain annotated function, method, and class signatures, constant definitions, and so on. The coding assistance quality relies, apart from anything else, on the quality of these signatures and their PHPDoc @annotations provided in the stubs.