ID: 36066 Comment by: alpha_centurion at hotmail dot com Reported By: pablobm at gmail dot com Status: Open Bug Type: Feature/Change Request Operating System: Any PHP Version: 5.1.2 New Comment:
I'd agree with this. Both from the perspective of people coming into PHP from other languages and an OO purist, the capacity to define public properties in interfaces is integral to their function. Although there is an argument which could support using interfaces purely for method signatures, it is more academic than practical and typically ends with some idea of separating property-focused interfaces from method-focused interfaces (facets of functionality). The usage strategy is something that should be decided in the implementation of software built on the language; the provision of the base functionality seems a logical (and necessary) progression of the language. Previous Comments: ------------------------------------------------------------------------ [2006-01-18 12:20:29] pablobm at gmail dot com Description: ------------ Maybe it's just me, but I think member variables should be allowed in object interfaces. My opinion is that this makes sense in PHP because it has proper getters/setters. Java allows mamber variables in interfaces for example, but, in its case, that doesn't make much sense, since (last time I checked, in 1.4) there are no proper getter/setter methods in Java as those found in PHP5. If I want an interface to define behaviour for a data structure that holds information, I will have to include getMember() and setMember() methods, not being able to use PHP5 getters/setters. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36066&edit=1