Hi!

> That is exactly what is being proposed though. People (including
> Anthony himself, along with other proposals) have previously
> suggested type hints which just casted. However, I don’t think this
> is terribly useful. You can already do that really easily (`$foo =
> (int)$foo;`), and it’s too lenient; the non-scalar type hints are
> useful because they validate your types, and the scalar ones, while
> casting, should validate to a degree.

PHP is weakly typed language, and 100% of existing code is written under
such assumption. If you mean to convert it to strictly typed language,
it won't be PHP. If you mean to make one small piece of it strictly
typed, while the rest is not, it would not give you the advantage of
strict typing (since you still can not prove anything about your code
beyond a very small piece of it) but give you all the disadvantages such
as increased development effort, more boilterplate code, etc.

> Keeping close to zpp would be nice, but zpp’s behaviour isn’t always
> the most sensible and useful one, but we should try to keep somewhat
> close to it.

If zpp behavior is not sensible, we should change it. However, having
consistent conversion rules is much better than have two sets of rules,
each of which make only a little sense, and forcing users to guess by
which set of rules they play each time. We have PHP.next where we can
break things, if some things in ZPP make no sense, we can break them and
fix them and have a good set of rules that does make sense. It is much
better than having two of them.

-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/

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

Reply via email to