Hi!
I will accept that sometimes it must always be done run time, eg:
$funcName($arg)
but that still allows most calls at compile time.
This is not the issue. This is the issue: $foo->bar($arg).
There's no way to resolve it in "compile time", whatever that means,
without having a type on $foo.
Anyway - the check for return type would be done in the called function,
not the calling function.
That's the point. You don't get any extra safety on the caller's side,
because you don't actually know much about the called function. With
checking arguments, it makes more sense as you are serving the called
function - so you know the code that ensures types and the code that
relies on this assurance is together and can rely on each other. There
are other problems with it, but not this one at least. Here you have the
assurance on one side and the code that relies on it on the other.
Which might be acceptable for some applications. For those where it is not
then this feature may not be useful. This is an *optional* declaration,
not mandatory - so if it does not suit your purpose -- don't use it.
You are talking about pretty big change in language nature - introducing
strict typing. "It's just option, don't use it if you don't want"
doesn't really sound good in this case. If it's in the language, it
should make sense and sit well with the rest of the language.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php