Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63397 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4768 invoked from network); 13 Oct 2012 21:21:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Oct 2012 21:21:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=amaury.bouchard@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=amaury.bouchard@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.42 as permitted sender) X-PHP-List-Original-Sender: amaury.bouchard@gmail.com X-Host-Fingerprint: 209.85.219.42 mail-oa0-f42.google.com Received: from [209.85.219.42] ([209.85.219.42:36681] helo=mail-oa0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/00-04349-07BD9705 for ; Sat, 13 Oct 2012 17:21:53 -0400 Received: by mail-oa0-f42.google.com with SMTP id j1so4314036oag.29 for ; Sat, 13 Oct 2012 14:21:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=K34PycFxwnaDNSQyXxs7wvyBPqNh8C2+ebmaUaRWgHA=; b=Mn8Fwst1Cc8d4iJyZ6AbnWyDESpNu73HPaKRDEXRdWjRTrir21OKKFv/pNXaCadqzN kQwdCbWcA7N3H+YUbmp5bLn3UpxQXnr1xbUbZcePnGiFOXvBBBOTw+PIZE+aZUFsqR5L 4TExp8onWgIFFJlhS2gX1UAppBQnZcTFtuHDVymshDYt/voklJLAxve/+2CRjpOYUVMG RUAE96Tq6AYQMq4f/DbvvMjmF6lnk42YTtkXS8VZ8pNE9kPdTF6Zexi8+X37LIj/20K0 oSkmJdzkoyhQgH7Tci5T39gB8dDS7wW+gI17bed2u4Z5u3kdI/TyY5wDWXJTfHmR2FJM 1r3g== Received: by 10.182.45.8 with SMTP id i8mr6524526obm.64.1350163310477; Sat, 13 Oct 2012 14:21:50 -0700 (PDT) MIME-Version: 1.0 Sender: amaury.bouchard@gmail.com Received: by 10.182.24.169 with HTTP; Sat, 13 Oct 2012 14:21:30 -0700 (PDT) In-Reply-To: <9570D903A3BECE4092E924C2985CE485612B5A54@MBX202.domain.local> References: <9570D903A3BECE4092E924C2985CE485612B53E4@MBX202.domain.local> <9570D903A3BECE4092E924C2985CE485612B59F6@MBX202.domain.local> <9570D903A3BECE4092E924C2985CE485612B5A54@MBX202.domain.local> Date: Sat, 13 Oct 2012 23:21:30 +0200 X-Google-Sender-Auth: 23Dd2YLyRF6uqgQPVBxxRYs2n1g Message-ID: To: Clint Priest Cc: Nikita Popov , Benjamin Eberlei , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=f46d044480ed8280a904cbf76411 Subject: Re: [PHP-DEV] [PHP-DEV [RFC] Property Accessors v1.2 From: amaury@amaury.net (Amaury Bouchard) --f46d044480ed8280a904cbf76411 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 2012/10/13 Clint Priest > Interfaces are used to define what methods must be present, properties > are not allowed.**** > > ** ** > > Yes, so no one should be correct, right?**** > > I mean, yes the first declaration implies some code; but for the > interface, it's still a property definition.**** > > ** ** > > You=92re mixing concepts here, it=92s an accessor definition, not a prope= rty > definition. property !=3D accessor, an accessor just happens to look and= act > like a property (which is the point of accessors). > Interfaces define methods, not properties. Fine. But is an accessor (as defined in the RFC) a method? Or should we consider that an accessor definition is valid inside an interface? I would say no, because it will be used as a property: outside of the object that implements the accessor, nobody know if it's an attribute or an accessor function. It's the whole point of the RFC (apart from the asymetric visibility, but you know my point of view). So, for me, this code should be incorrect: interface Fooable { public $abc { get; set; } } Because if an object implements the interface: class Fooer implements Fooable { public $abc { get { /* what you want */ } set { /* what you want too */ } } } How this code will be used? Like that: $foo =3D new Fooer(); $foo->abc =3D 3; print($foo->abc); Everybody will agree with me that $abc is used like a property, not as a method. So the language should enforce that. There is a real issue here; this is not a fad from me. --f46d044480ed8280a904cbf76411--