On Wed, Sep 16, 2009 at 1:59 PM, Chris Trahey <ctra...@csisd.org> wrote: > (Please direct me elsewhere if necessary, this is a feature request) > > It would be handy to allow a method to behave differently based on who is > calling it. > the function I am looking for would essentially do this: > .. snip ..
Type hinting would be a clean approach, I can not see a argument why the below would be less correct. public function registerMe(Loadable $oLoadable) { if( ! ($this->authenticateMod($oLoadable))) throw new admin_exception('module not active'); $this->loadedMods[$oLoadable->module_id()] = $oLoadable; return $oLoadable->onLoad(); } -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php