IMHO, optionally inclusion of type hinting for functions/methods can
only be a boon to code quality and readability. IMHO when a type hint is
provided and a parameter doesn't match the type hint then I think a
fatal error should occur. This forces the user of the function that has

So you code could blow up in random places in production because somebody wrote a plugin that called a typehinted class with wrong variable type (and remember, PHP has no variable typing, so you have no idea what type of the variable is in each particular place) without properly wrapping it.

type hinting to ensure their data is of the correct type. This prevents

Doing this how? Without full variable typing and static type control you can not do it.

accidental wrong data conversion. However, I see the other side of the

No, it doesn't. It makes your application blow up on data conversion. I would prefer having '1' converted to 1 instead of having my application fail.

function foo( require int $a, require string $b ){}

So now we have 2 additional syntaxes instead of one...

--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

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

Reply via email to