Re: [PHP-DEV] [VOTE][RFC] Scalar Type Hinting with Cast

[email protected] (Rowan Collins)
Newsgroups php.internals
Message-ID <[email protected]>
On 14/09/2014 17:41, Andrey Andreev wrote:
>> Perhaps I should explain what an “internal function” is in PHP parlance. An internal function is one which is exposed to userland, but is implemented in C via an extension, rather than in PHP. Examples include literally every function in PHP’s documentation.
> So why are we talking about "internal functions" at all? And what does
> that have to do with type hints?

Some of those internal functions, implemented in C, but used by userland 
developers every day, have type hinting built into them, and some don't. 
For instance, try passing a non-numeric string to mktime().

As Andrea points out, one of the big problems in this discussion is that 
those internal functions aren't actually consistent with one another - 
some of the logic is built into zned_parse_parameters, but fallback 
behaviour and additional checks are implemented ad hoc all over the 
standard library.

As a userland developer, this is actually rather confusing, and I'd be 
interested to know what it would take to come up with some finite set of 
base behaviours that documented what each function would do given the 
"wrong" types.

-- 
Rowan Collins
[IMSoP]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.