Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45593 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21422 invoked from network); 17 Sep 2009 16:46:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Sep 2009 16:46:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=chrisstocktonaz@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=chrisstocktonaz@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.222.198 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: chrisstocktonaz@gmail.com X-Host-Fingerprint: 209.85.222.198 mail-pz0-f198.google.com Received: from [209.85.222.198] ([209.85.222.198:62301] helo=mail-pz0-f198.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 67/87-13341-EC762BA4 for ; Thu, 17 Sep 2009 12:46:07 -0400 Received: by pzk36 with SMTP id 36so176219pzk.2 for ; Thu, 17 Sep 2009 09:46:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=HpFgDbq+lz6Hc1EchhpOsvh36uh72TE0HyvaenjA5UQ=; b=t30K0zXD3CuOLuzYkIJTiIYze+ImEBokQJKsSKl0tYNvyqXVJQ93+Ds7xUl0zxHjEO AY70XpNowl62XMyAnG9Ybasd4b0NCXHaBS0/6Md4qRq4AemESJpJuqUJgz6KRR6QSKPP rviJ6WUGIvlCh4BcbxhoLFTQRVaGMvwO8+k2s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=JXrNLHsm2zXZxziqFgLfJQHRtrf446HXX44dvrPcc8BTC82HAazUyp7bms5OwVmu1m +yaWqOY3g3JKUgigrQSAJMYuZ52tMXNqFzDMgeK9rxS3PnH7cN+iCNgYqhMCEkLpIpz2 /vfp3wd0MGLmpLYK22nMAGaiGmwJd83gLYVqA= MIME-Version: 1.0 Received: by 10.142.151.22 with SMTP id y22mr12156wfd.100.1253205964317; Thu, 17 Sep 2009 09:46:04 -0700 (PDT) In-Reply-To: References: Date: Thu, 17 Sep 2009 09:46:04 -0700 Message-ID: To: Chris Trahey Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] reference caller object From: chrisstocktonaz@gmail.com (Chris Stockton) On Wed, Sep 16, 2009 at 1:59 PM, Chris Trahey 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(); }