Namespace in PHP


 

Namespace in PHP

In this tutorial we will study about namespace in PHP, it is a new feature of PHP which is included in PHP 5.3.0. This is the index page on this topic, subsequent pages will focus on every point on this topic.

In this tutorial we will study about namespace in PHP, it is a new feature of PHP which is included in PHP 5.3.0. This is the index page on this topic, subsequent pages will focus on every point on this topic.

Namespace:

A namespace is a container which allows us to put the relevant classes, functions, objects etc. all together and helps us to make our programming better by allowing disambiguation of homonym items.

As per the rule of namespace we cannot assign same name to more than one class/function/namespace. For many modern computer/programming language a namespace is a context for identifiers.  Java uses this concept as package, C++ combines namespace and process names which is called as name mangling.

Following links will make your concept clearer:

 

Ads