On 02/17/2015 08:38 AM, Sara Golemon wrote:
> On Tue, Feb 17, 2015 at 12:22 AM, Rasmus Lerdorf <ras...@lerdorf.com> wrote:
>> Please correct me here if I somehow ran these incorrectly. I did put
>> some deliberate type errors into my userspace code and hh_client caught
>> those nicely, so it seems like it was working, but it didn't catch
>> anything when it came to calling the internal API functions.
>>
> The mechanisms are strict, but the definitions, in hack, are untyped,
> so there's nothing to validate:
> 
> hphp/hack/hhi/stdlib/builtins_string.hhi:
>   function number_format($number, $decimals = 0, $dec_point = ".",
> $thousands_sep = ",");

Right, so most of the internal API functions were omitted from strict
typing in Hack it looks like except for some places where it made sense
to selectively apply stricter checks. The RFC as it stands doesn't give
us this option which is my major problem with it.

> Perhaps a ZEND_ACC_STRICT flag which lets an API opt-in to strict mode?
> Or something passed to the arg_info struct? The details are secondary,
> but you get my meaning...

Yes, something along those lines to allow gradual and selective strictness.

The internal/extension api is just another library and the authors of
these library functions should have the same allowance as userspace
library authors. Like you said in one reply, "What's yours is yours,
what's theirs is theirs."

-Rasmus

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to