Re: Class Properties in Interfaces?
| From: | Robert Cummings | Date: | Wed, 30 Apr 2008 05:16:48 +0000 |
| Subject: | Re: Class Properties in Interfaces? | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-37327@lists.php.net to get a copy of this message | ||
On Tue, 2008-04-29 at 22:12 -0700, Stanislav Malyshev wrote:
> > an interface with an interface property of x, then all implementations
> > using that interface would know that property x exists and could use it
>
> You can use property in PHP without declaring it previously.
But then you need to check if it exists lest you raise an E_NOTICE
because it doesn't exist. Additionally, E_NOTICE is run-time, interface
checking is compile-time.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP