Re: Class Properties in Interfaces?
| From: | Marcus Boerger | Date: | Tue, 29 Apr 2008 09:46:07 +0000 |
| Subject: | Re: Class Properties in Interfaces? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-37285@lists.php.net to get a copy of this message | ||
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