For each use case, there are going to be ways to acheive results without new functionality. I think this feature doesn't make the impossible possible, it gives developers a consistent interface to access an object that is potentially very relevant, and perhaps not desired to be necessary in the method signature.
The decision to include a feature like this should not be made based on a particular use-case, but instead on the idea that the sender of a message should be able to be identified without enforcing a certain method signature or pulling a full backtrace. To me, this feels like a basic element of OOP. Chris Trahey Web Applications Developer Database Administrator CSISD [Technology] Chris Stockton <chrisstockto...@gmail.com> writes: >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 >