On Tue, 18 Jun 2019 at 20:37, Mark Randall <mar...@gmail.com> wrote:

> On 18/06/2019 18:53, Nikita Popov wrote:
> > This is not really possible, because we need completely accurate type
> > information. phpstorm-stubs is a good approximation especially when it
> > comes to "useful" return types, but it doesn't model things like possible
> > "false" return values with sufficient accuracy. Any type information we
> add
> > in php-src needs a careful review against the implementation.
>
> I say this with a certain amount of ignorance, but what about the
> existing manual?
>
> As the authoritative source of user-facing documentation, does it not
> contain an XML parseable signature for every method, in addition to a
> return value section detailing types and a standard boilerplate for
> things with falseable return values?
>
> The main issue I would see is "mixed" argument types in the signature
> which would require manual intervention.
>
> I'd certainly like to see a more comprehensive format. Stubs are great
> but stubs seem more like the end result rather than the original metadata.
>
> An XML or JSON file capable of expressing the names, types, defaults etc
> would have the added benefit of being easily extensible to cover things
> like descriptions or unions with different requirements for each type.
>
> Well-docblock'd stubs, C definitions, documentation pages etc would then
> be the drawn from the JSON rather than the other way.
>
> --
> Mark Randall
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php


Sadly this wouldn't be easy to pull off as the documented return values
don't include any error return value such as false or null;
and even some times the parameter values aren't in accordance as seen with
the null documented default values which can at times provoke an invalid
param error.

A good idea which can't work :(

Best regards

George P. Banyard

Reply via email to