Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81404 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87649 invoked from network); 30 Jan 2015 06:51:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jan 2015 06:51:22 -0000 Authentication-Results: pb1.pair.com header.from=francois@tekwire.net; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=francois@tekwire.net; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain tekwire.net does not designate 212.27.42.2 as permitted sender) X-PHP-List-Original-Sender: francois@tekwire.net X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:40192] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/F6-47940-8E92BC45 for ; Fri, 30 Jan 2015 01:51:22 -0500 Received: from moorea (unknown [82.240.16.115]) by smtp2-g21.free.fr (Postfix) with ESMTP id CF2C34B017C; Fri, 30 Jan 2015 07:48:16 +0100 (CET) Reply-To: To: "'Larry Garfield'" , , "'S.A.N'" References: <54CB0BD4.8060402@garfieldtech.com> In-Reply-To: <54CB0BD4.8060402@garfieldtech.com> Date: Fri, 30 Jan 2015 07:51:12 +0100 Message-ID: <022601d03c59$23150380$693f0a80$@tekwire.net> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQGQ6cvw5mkk/4hoOdrmibZco5TvEwIXHiWgAvcB9hECdCCU650aynWQ Content-Language: fr X-Antivirus: avast! (VPS 150129-1, 29/01/2015), Outbound message X-Antivirus-Status: Clean Subject: RE: [PHP-DEV] Use "caller" keyword, to access object caller. From: francois@tekwire.net (=?UTF-8?Q?Fran=C3=A7ois_Laupretre?=) > De : Larry Garfield [mailto:larry@garfieldtech.com] > > Having an object that behaves differently depending on an implicit > relationship with where it happened to be called from is full of all > kinds of impossible to debug magic. I don't even know how you'd unit > test it. I can think of no use case where this wouldn't cause only > problems. The only use case I can think of is to enforce access restriction (an = alternative to 'friend' classes), faster than using debug_backtrace(). = But I would prefer really implementing friend classes/namespaces. @S.A.N: you can already determine the caller using debug_backtrace(). = Slow and inconvenient, but it works. Regards Fran=C3=A7ois