Re: Class Properties in Interfaces?

From: Date: Wed, 30 Apr 2008 05:40:09 +0000
Subject: Re: Class Properties in Interfaces?
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  Groups: php.internals 
Request: Send a blank email to internals+get-37330@lists.php.net to get a copy of this message
On Tue, 2008-04-29 at 22:21 -0700, Stanislav Malyshev wrote: > > 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. > > I don't understand what you mean here. PHP can't check variable accesses > compile-time. In fact, in PHP "compile-time" doesn't mean much anyway, > since everything is runtime. Oh, I'm sorry, perhaps I should have said parse time-- either way PHP does compile an internal bytecode so compile-time is not incorrect. Obviously interface errors are detected when the script is parsed NOT when the code itself is run. if PHP can check method definition compliance when the script is parsed, surely it can check property definition compliance also. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP

« previous php.internals (#37330) next »