Hello Alain,

I think you are also confused about PHP type hinting...

The manual clearly states:


    > Type Hinting

> PHP 5 introduces Type Hinting. Functions are now able to force
parameters to be objects (by specifying the name of the class in the
function prototype) or arrays (since PHP 5.1).

And suddenly you want to change that definition to

"Functions are now able to force parameters to be types that *could be
casted* to objects/arrays."

That is not going to happen. Type hints are supposed to force parameter
to be of a specific type. Any kind of auto conversion would redefine
type hinting and would be just another feature that gives PHP haters a
reason to rant about.
And if you want that '1' is allowed to be passed as parameter (without
an actual int cast) because it COULD BE CASTED to int then you gain
ABSOLUTELY nothing from the type hint. Then you don't need to introduce
them at all.

Stefan Esser

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

Reply via email to