There is nothing in the code above that would produce an undefined error. So unless some other code is triggering this error, or one of your variable names is different (remember they’re case sensitive), then the above has no reason to output an error.
@cpradio, omitting the last semicolon before the closing PHP tag is optional, so it would not be the cause of this (or any) error.