Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63724 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52330 invoked from network); 30 Oct 2012 21:52:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Oct 2012 21:52:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.203 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.203 smtp203.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.203] ([67.192.241.203:53395] helo=smtp203.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/10-51568-01C40905 for ; Tue, 30 Oct 2012 16:52:18 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp20.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 3B8022C8008; Tue, 30 Oct 2012 17:52:14 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp20.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 538852597E9; Tue, 30 Oct 2012 17:52:13 -0400 (EDT) Message-ID: <50904C0C.8030207@sugarcrm.com> Date: Tue, 30 Oct 2012 14:52:12 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Nikita Popov CC: Clint Priest , PHP Developers Mailing List References: <508A67E6.2000405@zerocue.com> <508A9AC9.50200@sugarcrm.com> <508AF3E7.7020004@sugarcrm.com> <508B1EA2.8060203@sugarcrm.com> <508C249D.1000309@zerocue.com> <508C43ED.9000209@sugarcrm.com> <508C80C6.9000008@zerocue.com> <508CD916.1070509@sugarcrm.com> <508D5462.4070503@zerocue.com> <508EFB76.4080604@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Property Accessors v1.2 : Internal Accessor Method Visibility / Callability From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > Stas, you seem to have missed the point behind my mail. This wasn't > about what the exact details of the implementation will be, the > message was that the semantics of a dedicated accessors syntax and the > semantics of a magic implementation can not match. I see your point now, thanks, but I don't think I agree. > > E.g. assuming that magic accessors take priority over properties as > you want it this time I can just turn the examples around: > > class A { > public $foo { get() { ... } set($value) { ... } } > } > > class B extends A { > public $foo; > } > > => Here I would expect that public $foo from class B overrides public > $foo from class A. I'm not sure why you are expecting this, and also this is probably an LSP violation, since such override would change semantics of the value that A clients expect. It may be possible to implement, technically, but I'm not sure it's the right thing to do. > Basically any kind of interaction between properties and accessor > properties will be broken and inherently so, simply because magic > methods are not real properties (quite obviously...). Magic methods are not properties, they are implementation of properties. But your properties aren't either - see discussion about interfaces, etc. They simulate regular properties but they aren't regular properties. E.g., what would happen if you serialize an object with simulated property? -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227