[TYPO3-core] Patch for uninitialized variable in class.tslib_pagegen.php

Holzinger Franz franz at fholzinger.com
Sat Dec 31 16:10:08 CET 2005


Hello Dmitry,

>Hi!
>
>Holzinger Franz wrote:
>  
>
>>bad
>>    
>>
>
>I would prefer longer comment :)
>  
>
My comment has been in the lines before:

>I do not think this makes it more understandable. And it is breaking the
>switch clause by a return.
>Better solution:
>use a $rc variable and return it after the switch clause.
>

>As to "break" after "return" - it is a question of style and habbit. I do not
>use breaks after returns and prefer not to have unreacable code. It still
>compiles and takes time...
>  
>
The code is not so easily readable when a function can be left inside of
a switch-case. So this can lead to errors or longer time to understand a
function. If possible, a function should have only one return at the end.

With PHP5 this can be changed in the future to use 'try catch' blocks
instead of this.
So I see no reason to remove the breaks now.


Franz







More information about the TYPO3-team-core mailing list