Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37289 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51053 invoked from network); 29 Apr 2008 10:23:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Apr 2008 10:23:36 -0000 Authentication-Results: pb1.pair.com smtp.mail=johncart@cisco.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=johncart@cisco.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain cisco.com designates 144.254.224.140 as permitted sender) X-PHP-List-Original-Sender: johncart@cisco.com X-Host-Fingerprint: 144.254.224.140 ams-iport-1.cisco.com Received: from [144.254.224.140] ([144.254.224.140:64351] helo=ams-iport-1.cisco.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 26/8F-04029-527F6184 for ; Tue, 29 Apr 2008 06:23:35 -0400 X-IronPort-AV: E=Sophos;i="4.25,722,1199660400"; d="scan'208,217";a="7602999" Received: from ams-dkim-2.cisco.com ([144.254.224.139]) by ams-iport-1.cisco.com with ESMTP; 29 Apr 2008 12:23:23 +0200 Received: from ams-core-1.cisco.com (ams-core-1.cisco.com [144.254.224.150]) by ams-dkim-2.cisco.com (8.12.11/8.12.11) with ESMTP id m3TANN5g014473 for ; Tue, 29 Apr 2008 12:23:23 +0200 Received: from xbh-ams-332.emea.cisco.com (xbh-ams-332.cisco.com [144.254.231.87]) by ams-core-1.cisco.com (8.13.8/8.13.8) with ESMTP id m3TANNeT024873 for ; Tue, 29 Apr 2008 10:23:23 GMT Received: from xmb-ams-33e.emea.cisco.com ([144.254.231.75]) by xbh-ams-332.emea.cisco.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 29 Apr 2008 12:23:23 +0200 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C8A9E3.0DC1AB4D" Date: Tue, 29 Apr 2008 12:22:53 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: In-Reply-To: <462e563f0804290316p7549f104p9ec14dc4ff7b5606@mail.gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP-DEV] Class Properties in Interfaces? Thread-Index: Acip4ij6iC1bJFRxQwCqvAHILxTsdAAAERBQ References: <48169695.9040803@omegavortex.net> <339714303.20080429114607@marcus-boerger.de> <462e563f0804290316p7549f104p9ec14dc4ff7b5606@mail.gmail.com> To: X-OriginalArrivalTime: 29 Apr 2008 10:23:23.0528 (UTC) FILETIME=[0DDC7080:01C8A9E3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; l=8022; t=1209464603; x=1210328603; c=relaxed/simple; s=amsdkim2001; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=johncart@cisco.com; z=From:=20=22John=20Carter=20-X=20(johncart=20-=20PolicyApp= 20Ltd=20at=20Cisco)=22=20 |Subject:=20RE=3A=20[PHP-DEV]=20Class=20Properties=20in=20I nterfaces? |Sender:=20; bh=vlp9FRSVil56eIKJBoXR54UYxYEWFi5OrrstcT+7qUc=; b=jqnQHIB82EEPz77ODVrwsCMcGmmj/4F9IzLY/LUipyDTfDew20VpHFeX++ 1A6WvTGjJOYXbNXbtfYA5AXjcd291DqLS0e1fNgnegUpYIsFtj4zsr9xA/O+ rMQ0PFMBbi; Authentication-Results: ams-dkim-2; header.From=johncart@cisco.com; dkim=pass ( sig from cisco.com/amsdkim2001 verified; ); Subject: RE: [PHP-DEV] Class Properties in Interfaces? From: johncart@cisco.com ("John Carter -X (johncart - PolicyApp Ltd at Cisco)") ------_=_NextPart_001_01C8A9E3.0DC1AB4D Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable It might be bad design, but design is down to the application developer and not the people who define a language. =20 I'm not necessary asking for the feature, I just want to understand why we can't do it. =20 John. ________________________________ From: James Dempster [mailto:letssurf@gmail.com]=20 Sent: 29 April 2008 11:17 To: John Carter -X (johncart - PolicyApp Ltd at Cisco) Cc: internals@lists.php.net Subject: Re: [PHP-DEV] Class Properties in Interfaces? I would start by saying it's bad design. you should use getters and setters which you can define in you interface -- /James On Tue, Apr 29, 2008 at 11:07 AM, John Carter -X (johncart - PolicyApp Ltd at Cisco) wrote: Marcus, =09 I understand why Interfaces can't have bodies, but could you explain why Interfaces can't have properties? =09 Thanks, =09 John. =09 -----Original Message----- From: Marcus Boerger [mailto:helly@php.net] Sent: 29 April 2008 10:46 To: Jeremy Privett Cc: PHP Developers Mailing List Subject: Re: [PHP-DEV] Class Properties in Interfaces? =09 Hello Jeremy, =09 interfaces cannot have properties, nor can they have method bodies - that is the whole purpose of interfafces. We are thinking of adding traits which would allow for both but would treat inheritance differently. Until we get that you would need to provide an abstract interface to access data in the same way. =09 marcus =09 Tuesday, April 29, 2008, 5:31:33 AM, you wrote: =09 > Hey list, =09 > I was curious what everyone thought of implementing the ability to > specify class members in interfaces. I've run into a couple of > circumstances where I would like to specify public member names inside =09 > of an interface to ensure that these members are accessed in a > standard way and to ensure that they exist. Currently, trying to > include them in an interface results in "*Fatal error*: Interfaces may =09 > not include member variables in file/line number". =09 > Thoughts? =09 > Thanks. =09 > -- > Jeremy Privett > C.E.O. & C.S.A. > Omega Vortex Corporation =09 > http://www.omegavortex.net =09 > Please note: This message has been sent with information that could be =09 > confidential and meant only for the intended recipient. If you are not =09 > the intended recipient, please delete all copies and inform us of the > error as soon as possible. Thank you for your cooperation. =09 =09 =09 =09 =09 Best regards, Marcus =09 =09 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php =09 =09 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php =09 =09 ------_=_NextPart_001_01C8A9E3.0DC1AB4D--