[TYPO3-dev] [TYPO3-core] RFC: #13697: Add possibility to retrieve extension version

Sigfried Arnold s.arnold at rebell.at
Wed Mar 10 13:16:50 CET 2010


Am 10.03.2010 12:49, schrieb Oliver Klee:
> An API that doesn't have clean types (for parameters and return values)
> makes working with it harder: If this function e.g. can return both a
> string or a boolean, the caller needs to make sure that it is a string
> before e.g. applying string functions on the return value (like doing a
> split for the version parts). It's easy to forget this check, and this
> will result in all types of hard-to-track bugs (especially if all the
> developer remembers is "this function usually returns a string").
>
> Working with a variable if its type is known is easier and less error-prone.

I agree - but in PHP it's very common that a function returns multiple 
data types. preg_match for example returns "false" if an error occurs 
and an integer (with the amount of matches) on success.




More information about the TYPO3-dev mailing list