views:

801

answers:

2
+2  Q: 

Packages in PHP?

Is it possible to create packages of related class and have the same protected and private fields which are visible only to classes from the same package? Basically, the same type of packages as what Java has?

Is it possible?

+2  A: 

Nope. PHP has no package or friend-class support.

chaos
+1  A: 

Right now, there is no concept of package.

However, PHP 5.3 is going to introduce namespaces. I'm not sure about how that will affect visibility between classes.

bobwienholt