[TYPO3-core] RFC: uninitialized variables code cleanup

René Fritz rene at typo3.org
Thu Jan 19 11:23:00 CET 2006


>  My practice is that I initialize only arrays and boolean variables,
>  I rarely set a string to '' (if not really required) and I
>  suggest to use the same practice here (as PHP has weak typing anyway
>  and this only clutters up code IMHO).

Generally I tend to init variables on top if that is the return var. Strings 
too:
$content = '';
...
return $content;

But of course it's not needed and I would like to do that because of the IDE 
messages mainly.

>  Another change in connection with this is to return 'true' or 'false'
>  explicitly where a boolean return value is expected

Yes.

René

-- 
René Fritz
TYPO3 Association - Active Member
http://association.typo3.org/



More information about the TYPO3-team-core mailing list