On 03/28/2003 05:34 AM, Marcus Börger wrote:
I have not had time to look this in detail so I could not reach a conclusion.
Is the upcoming object model supporting package level member access retrictions like in Java?
For those that are not aware of what is that, packages are a group of independent classes (not like nested classes).
The members with package level access restriction can only be accessed from functions of classes of the same package.
PHP is not JAVA.
I was not asking because Java has them but rather because package level access restrictions are a Good Thing (tm) for better access management organization between classes that belong to the same package.
Your comment is very curious because after all, many things have been copied from Java to Zend Engine 2 like: private, protected, public, final, abstract, interfaces, nested classes.
AFAIK, at least some of these things will make PHP 5 code execute slower than PHP 4 because they imply making additional checks at run-time, unlike Java and other languages that only enforce them at compile time.
Maybe I missed the reasoning about adding such features but it sounded to me like it was meant to make PHP have Java features.
Anyway, I am not suggesting or defending the support of package level access restriction, I was just asking if it would be made available, although it is odd that it will support private, protected and public and not package.
Adding Packages and restictions which do not even have a name? Who besides very expirienced
JAVA programers should understand it?
Duh?! I do not program in Java and I perfectly understand the point of package level access restrictions. Maybe you do not understand it because you are not used to develop packages of classes.
Although I just mentioned Java to help explaining clearly what I meant, in case you are not aware, I would like to add package is Java default access restriction mode (public in PHP and private in C++) because it is very common to ship classes as in packages.
Since Zend Engine 2 supports namespaces, it makes all the sense to support package access level restrictions as packages and namespaces are directly related concepts, not to say they the same thing.
--
Regards, Manuel Lemos
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php