Well, of course. Let's say you have $fonts==2 when this bit of code is reached. What happens depends on whether $fontsize is set or not:
1) Is $fontsize set? No.
2) register the $fontsize variable.
3) Set $fontsize=1.
Where did $fontsize get set to 2?
The other scenario:
1) Is $fontsize set? Yes; jump to the "else" branch.
2) Set $fontsize=$fonts
Where did $fontsize get registered?