Hi Zeev,

On Thu, Mar 12, 2015 at 12:10 AM, Zeev Suraski <z...@zend.com> wrote:

> The latest version of the RFC includes changes discussed on internals@
> last
> week:
>
> 1.  Accept string->bool and int->bool conversions (false->bool is not
> supported)
>
> 2.  Accept leading/trailing spaces in string->number conversions.
>
>
>
> wiki.php.net/rfc/coercive_sth
>
> wiki.php.net/rfc/coercive_sth#vote
>

Status should be changed to "voting". It's "under discussion" now.

It's not nice to have 2 modes for new feature while we can do it in a
single mode.
BC matters, but cleaner and simpler design would bring more benefits for
both PHP
users and developers. There is enough time to adopt for users.

The default behavior is better with this RFC. Weak mode defined in other
RFC is too
weak to be useful while strict mode seems too restrictive.

e.g.
<?php
function check_num_range(int $num) { if ($num < 0 || $num > 100)
trigger_error('Invalid range'); }
// Somewhere far from function definition.
$num = $GET['num'];
// Somewhere far from $num definition.
check_num_range($num); // Trying to check validity, int and range.
echo 'You have '.$num. ' now <br />'; // But $num could have any string.
                                                            //
"check_num_range((int)$num)" wouldn't help also.
?>

If we decide to have even more stricter hint in the future, we may decide
to use "strict"
mode with this RFC. This is more preferable path for PHP being type aware.
IMHO.

For these reasons, I voted "yes" for this, "no" for the other.

Regards,

--
Yasuo Ohgaki
yohg...@ohgaki.net

Reply via email to