'switch' looks much nicer, and is better if the '$something' is a definate - like 'cheese' or 'biscuits'
'if' statements can handle complicated expressions '$something>8' (yeah, complicated I know :-) ). I'm not too sure that 'switch' can perform math functions. 'if' staments could get very complicated after 2-3 'elseif' 's. I admit, I haven't used switch, despite knowing of it's existance. I should use it more often.
and
I'm just not sure why you would use one over the other.
If you're picky, here are some differences that I see:
The first one has 134 characters, and the second has 154.
The second one is more legible to me than the first, though it's only preference.
If I were to decide on which to use, I would pick the one that is most like the rest of my code.
'if' statements can handle complicated expressions '$something>8' (yeah, complicated I know :-) ). I'm not too sure that 'switch' can perform math functions. 'if' staments could get very complicated after 2-3 'elseif' 's. I admit, I haven't used switch, despite knowing of it's existance. I should use it more often.