Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81527 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73109 invoked from network); 1 Feb 2015 10:10:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Feb 2015 10:10:40 -0000 X-Host-Fingerprint: 80.177.120.119 marston-home.demon.co.uk Received: from [80.177.120.119] ([80.177.120.119:15876] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/84-01632-E9BFDC45 for ; Sun, 01 Feb 2015 05:10:39 -0500 Message-ID: To: internals@lists.php.net References: <54CD6AD6.9080209@gmail.com> In-Reply-To: Date: Sun, 1 Feb 2015 10:10:11 -0000 Lines: 3 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 16.4.3528.331 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 X-Posted-By: 80.177.120.119 Subject: Re: [PHP-DEV] Use "caller" keyword, to access object caller. From: TonyMarston@hotmail.com ("Tony Marston") ""S.A.N"" wrote in message news:CALW=WEDFmUXap7Bx=chHx5VYHcOi1kBahgDkJiF2aDLx6YT6Jg@mail.gmail.com... > >2015-02-01 1:52 GMT+02:00 Stanislav Malyshev : >> Hi! >> >>> The reason for creating circular references, usually due to the need to >>> bind objects. >>> >>> But this relationship can often be obtained from the context of the >>> call. >> >> If the API behaves differently depending on who is calling it, or >> requires some information from the caller, it should be passed >> explicitly - as a parameter/method call/etc. - not hidden. Otherwise it >> would lead to nasty surprises when the user of the API assumes caller >> does not matter but the implementor assumes it does. >> -- >> Stas Malyshev >> smalyshev@gmail.com > >This is a controversial statement. >If the caller explicitly send the object as an argument, it worsens >loose depending API. And how is this different from Dependency Injection which is supposed to be a common and accepted technique? -- Tony Marston