> > If the static analyser was programmable, it would be possible to
> > provide it such information, within the scope of a single code base.
>
> In the case of data returned from a database, the metadata for the
> database is another source of information relating to that data, and it
> would be useful if PHP had a means to access that data, but in reality
> this is still currently an area for developing 'a single code base'
> within the IDE level rather than PHP itself?
>

I already do this to a small extent with my code using Psalm, and
intend to explore it more deeply in the future. I was just making the
point that having this ability is useful, in case the PHP project were
to develop a 'core' static analysis system.

Specifying this information directly in the code, vs specifying it at
the level of an API is, in my opinion, just an application of
separation of concerns. Having an API for it allows type checking to
be applied to existing dynamic code bases which make use of dynamic
functionality in a statically knowable way, which cannot be expressed
within the type system.

And yes, I do believe that having a result set be a simple associative
array is perfectly fine. I defer why to the lecture 'simple made
easy', available on youtube and else ware.
.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to