Open TysonAndre opened 5 years ago
cc @nikic - This may be able to automate some of the work involved in generating PHP stub files from the implementation.
This already supports reading calls to zend_parameter_parse*
, and parsing the fast parameter API is planned. If I convert the strings/functions to php types for params/returns, then stubs could be automatically created (and manually reviewed and compared against other type sources)
php-src/scripts/dev/check_parameters.php
makes this largely redundant.https://github.com/TysonAndre/php-src-ast-analysis/blob/master/example_php80_types.txt is the most up to date version.
See https://github.com/TysonAndre/php-src-ast-analysis/blob/e2f7f4beaba44e7121e4f74a28a43604a42c51a5/example_php80_types.txt#L899-L936
e.g. spl_object_id is missing. I don't know if there are conditions for not adding builtin functions to the map.
Note that the outputted signatures containing
null
are usually inaccuratePhan's real signature map in /phan/src/Phan/Language/Internal/FunctionSignatureMapReal.php (which used opcache) is out of date, it was generated in June