TysonAndre / php-src-ast-analysis

1 stars 0 forks source link

Look into contributing missing signatures and types to zend_func_info in opcache #1

Open TysonAndre opened 5 years ago

TysonAndre commented 5 years ago

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 inaccurate

Phan's real signature map in /phan/src/Phan/Language/Internal/FunctionSignatureMapReal.php (which used opcache) is out of date, it was generated in June

TysonAndre commented 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)

https://github.com/TysonAndre/php-src-ast-analysis/blob/master/example_php80_types.txt is the most up to date version.