Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99753 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17491 invoked from network); 5 Jul 2017 07:09:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jul 2017 07:09:05 -0000 Authentication-Results: pb1.pair.com header.from=sebastian@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=sebastian@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 188.94.27.5 as permitted sender) X-PHP-List-Original-Sender: sebastian@php.net X-Host-Fingerprint: 188.94.27.5 scarlet.netpirates.net Received: from [188.94.27.5] ([188.94.27.5:54530] helo=scarlet.netpirates.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E7/C7-15131-9809C595 for ; Wed, 05 Jul 2017 03:08:59 -0400 Received: (qmail 10532 invoked by uid 89); 5 Jul 2017 07:08:54 -0000 Received: by simscan 1.4.0 ppid: 10524, pid: 10527, t: 0.1735s scanners: attach: 1.4.0 clamav: 0.99.1/m:/d:20700 Received: from unknown (HELO ?172.16.3.86?) (php@sebastian-bergmann.de@109.49.150.190) by scarlet.netpirates.net with ESMTPA; 5 Jul 2017 07:08:54 -0000 To: internals@lists.php.net Reply-To: internals@lists.php.net Message-ID: <827b77ce-f2b7-930a-34cb-ce11ebc2d531@php.net> Date: Wed, 5 Jul 2017 08:08:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: OBJECT_OPERATOR vs. DOUBLE_COLON From: sebastian@php.net (Sebastian Bergmann) Is it intentional that the DOUBLE_COLON operator can be used on a variable that contains a reference to an object? ) can be used on a variable that contains an object. https://3v4l.org/59Xap proved me wrong. As the deprecation / strict standards notices suggest, though, $c::m() does not invoke the method m() on the object referenced by $c. It invokes the method statically on C (the class of the object referenced by $c): https://3v4l.org/19taB I think that using :: on a variable that contains an object should not "fall back" to a static access on the object's class. Instead the runtime should error out. What do you think?