Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Packages in PHP?

Tags:

oop

php

Is it possible to create packages of related classes and have the same protected and private fields which are visible only to classes from within the same package?

Basically, the same type of packages as what Java has. Is it possible?

like image 939
Ali Avatar asked Feb 10 '09 22:02

Ali


2 Answers

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.

like image 170
bobwienholt Avatar answered Sep 21 '22 15:09

bobwienholt


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

like image 27
chaos Avatar answered Sep 17 '22 15:09

chaos