Hi, all

At first, many thanks to Anthony for writing the code!

2012/3/9 Anthony Ferrara <ircmax...@gmail.com>
> fooi(1.5); // int(1)

Here an E_NOTICE would be a minimum as we are modifying the data. I'd
like to see an E_RECOVERABLE_ERROR as well. You should use
float-casting instead if you want to allow this as well.
And this should be the only difference between int and float. (Float
will of course also accept strings like "1.5")

One more question I have to raise here ... is ".5" a valid float? Or
do I have to change it to "0.5" to get it valid?

2012/3/9 Nikita Popov <nikita....@googlemail.com>
>
> a) I'm not sure that we really want to accept '123abc' on an int cast
> with just a notice. In my eyes that is clearly malformed input, which
> should not be accepted.

In my opinion '123abc' is not a valid integer as well.

2012/3/9 Nikita Popov <nikita....@googlemail.com>
>
> b) The bool cast rules also accept lots of input with dataloss. At
> least the fact that "abc" is considered a valid bool seems odd.

I think all values that are not castable to an integer 0 or 1 should
fail in Boolean.

I pretty much like the rest.
But as we are allowing classes implementing __toString() we should
also think about updating the array type-cast - but that's another
discussion that we can pick up later.

Bye
Simon

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

Reply via email to