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) <[EMAIL PROTECTED]> wrote: > Marcus, > > I understand why Interfaces can't have bodies, but could you explain why > Interfaces can't have properties? > > Thanks, > > John. > > -----Original Message----- > From: Marcus Boerger [mailto:[EMAIL PROTECTED] > Sent: 29 April 2008 10:46 > To: Jeremy Privett > Cc: PHP Developers Mailing List > Subject: Re: [PHP-DEV] Class Properties in Interfaces? > > Hello Jeremy, > > 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. > > marcus > > Tuesday, April 29, 2008, 5:31:33 AM, you wrote: > > > Hey list, > > > 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 > > > 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 > > > not include member variables in file/line number". > > > Thoughts? > > > Thanks. > > > -- > > Jeremy Privett > > C.E.O. & C.S.A. > > Omega Vortex Corporation > > > http://www.omegavortex.net > > > Please note: This message has been sent with information that could be > > > confidential and meant only for the intended recipient. If you are not > > > the intended recipient, please delete all copies and inform us of the > > error as soon as possible. Thank you for your cooperation. > > > > > > Best regards, > Marcus > > > -- > PHP Internals - PHP Runtime Development Mailing List To unsubscribe, > visit: http://www.php.net/unsub.php > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >