On 11 August 2010 01:50, Stas Malyshev <smalys...@sugarcrm.com> wrote:
> Hi!
>
>> Derick's point was about consistency. The approach described in his
>> mail is consistent with current syntax and mechanism(s). Current
>
> No it is not. There's no functions that produce errors when fed 1 instead of
> boolean "true" - all internal functions convert.

First of all, I am talking about the typehinting syntax and mechanism
here. As Derick pointed out, current typehints are strict.

Secondly, I don't support amalgaming userland with internal functions.
If I was to treat those internal functions as if they were written in
userland, I'd say that they don't use scalar typehints, specifically
for the reason you mentionned. Internal functions just typecast
whatever you throw at them, no question asked.

> That's exactly how internal functions worked in PHP for 10 years -
> "sometimes" (meaning when the type is wrong) typecast. That's how the rest

Again, I'm not talking about internal functions but typehinting. Now,
when a userland developer uses typehints it means they expect a
variable of a certain type to be passed. If they want typecasting,
Derick proposes a convenient way to do that.

> How it's "ambiguous"

The current typehinting system does not typecast. Changing that
behaviour makes it ambiguous. It introduces a new behaviour grafted
onto the old mechanism and without a new syntax.

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

Reply via email to