Re: Use "caller" keyword, to access object caller.
| From: | Stanislav Malyshev | Date: | Sat, 31 Jan 2015 23:52:54 +0000 |
| Subject: | Re: Use "caller" keyword, to access object caller. | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-81503@lists.php.net to get a copy of this message | ||
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