Hi,

I am -1 on the inclusion of cast support. IMHO this part isnt thought out and was just thrown in to silence those who feel that there is a use case for non strict type hinting. But in that case I might as well leave the type cast in the API calling code. The number of characters saved are next to nothing, the performance impact is probably also fairly irrelevant and with this syntax I get slapped and then I can choose if I want to cast manually or do something else. But just hiding things by just blindly casting seems counter productive (which is why I proposed to add reasonable checks before doing the cast in my RFC that would make things more compatible with data coming out of a database, config file or other trusted data source). I just do not see what is gained at all from:

A) foo((int)$bar);
function bar(int $bar) {}

vs.

B) foo($bar);
function bar((int) $bar) {}

What am I really saying with B)?
I don't care what you give me, I am going to use it as an int anyways?

IMHO no need to introduce a special syntax for this.

Of course I am also quite opposed to sticking this into 5.3.

Finally I would like to ask to rename this entire feature (including what we currently already have) to "type checking" or something other than "hint" in the documentation.

regards,
Lukas Kahwe Smith
m...@pooteeweet.org




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

Reply via email to