Hi!

> oa-res-27-90:php-src ajf$ sapi/cli/php -r 'function foobar(int $a) {
> var_dump($a); } foobar(1.5);'
> 
> Catchable fatal error: Argument 1 passed to foobar() must be of the
> type int, float given, called in Command line code on line 1 and
> defined in Command line code on line 1

Calling this "scalar type hinting with cast" when it doesn't actually
cast in wide variety of cases sounds a bit misleading to me. It should
be called "scalar type checking with restricted casting" or something
like that.

I would also ask to clean up an RFC a bit and to clarify which of the
proposed choices and "possible changes" are actually being voted for
when somebody votes "yes".

In any case, I call everybody to vote against this RFC in this form,
since it introduces inconsistency between internal and user functions
and makes PHP have two different arbitrary sets of rules for implicit
conversions, and this can not be good for PHP.
-- 
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