by Andrew Normore.
Remember to use global $USER in your function, that usually gets missed.
Then you can var_dump($USER) and make sure your twitter field is actually there.
Then, it should be echo $USER->profile->twitter