Re: Question about adding !function_identifier
| From: | Robert Hickman | Date: | Fri, 05 Apr 2019 13:05:45 +0000 |
| Subject: | Re: Question about adding !function_identifier | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-105109@lists.php.net to get a copy of this message | ||
On Fri, 5 Apr 2019 at 13:15, Rowan Collins <rowan.collins@gmail.com> wrote:
>
> On Fri, 5 Apr 2019 at 12:42, Robert Hickman <robehickman@gmail.com> wrote:
>>
>> In the first case:
>>
>> function foo(callable $bar): int { return $bar(); }
>>
>> I think the value of $bar would have to fall into a set of values
>> known to the programmer, or at least known at some level.
>
>
>
> I think you're misunderstanding the problem: it's not that the *programmer*
> doesn't know the types, it's that the *analysis tool* doesn't know them, because the
> programmer hasn't told it, and currently has no way to tell it.
>
If the static analyser was programmable, it would be possible to
provide it such information, within the scope of a single code base.