Translations:Developers/Object oriented programming in PHP/Exceptions/9/en

The example method sets the type for each entry in the $values array. If no one is available, no type is added to that value and it doesn't make sense to throw an exception here when it's not required that every entry must have a type. This is also applicable to methods that are likely to fail, because then it's easier to check it's return value in the calling code than wrapping a try/catch block around the single method call.