On 17/02/2015 15:47, Anthony Ferrara wrote:
If we want to add a "numeric" type as a virtual union of int and
float, that's one way to solve the concern. If we don't, we could also
allow widening primitive conversion (int -> float). That wouldn't work
well with bigints, but would be fine in other cases. But there are
plenty of languages that always require explicit type conversion. So
even if we choose that, we're in good company.

As far as I understand, allowing int -> float would help fix a few of Rasmus' (or was it Benjamin?) concerns about things like sin() requiring floats in strict mode. It would make strict mode a lot more usable with C code as well. +1 on keeping the strictness benefits and remove some of the drawbacks.

Having numeric in addition might be nice mostly for return values I guess, but it seems a bit redundant to me if int -> float is allowed.

As for the straw poll, I also think declare() is the clearest syntax, especially if it's enforced to appear at most once and on top of the file to remove any potential misuses.

Cheers

--
Jordi Boggiano
@seldaek - http://nelm.io/jordi

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

Reply via email to