you may check also the runkit/classkit functions. there are some requirements though.