Sure, but staying in school until your 30's is a bit ridiculous. Only so many people can do it. Think about it. You're living off of somebody else's dime until almost 40.
If you are actually trying for academia (and are considered as have a good chance of doing so), rather than being in academic wrappings around professional education, you should have consistent TA/RA/fellowships, and while it can be argued that, in living off research funding, you're living off someone else's dime, aren't you likely going to be living off that same dime the rest of your life?