ZF-3290: Zend_Locale::setDefault should check input type and react with Exception


When inserting non-string value to Zend_Locale::setDefault, PHP warning is issued:

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in ... on line 240

Zend_Locale should check type of parameter and throw an Exception in case the variable !is_string()


And why do you think is there a API doc where "string" is defined as input format ?

Well, I certainly would not try to force non-string value as a parameter, but phpdoc will not prevent me to do so by mistake. Moreover, ZF converts PHP errors to exceptions (or prevents them in the first place) on so many other places, so I don't see a reason why not to do so in this case.

There is no array_key_exists call within the trunk. Seems to be fixed somewhere in the past.

Updating for the 1.6.0 release.