Namespace in PHP
Posted on: April 1, 2010 at 12:00 AM
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:

 

Namespace Declaration
In this tutorial we will study about namespace declaration in PHP, how to declare namespace in PHP, how to access etc. Examples will make this clearer.
 
Calling Namespace
In this tutorial we will study about namespace declaration and calling from other file in PHP, how to call a namespace in PHP, how to access from outside the file etc. Examples will make this more clear.
 
Multiple Namespace
In this tutorial we will study about multiple namespace declaration in PHP, how to declare namespace in PHP, how to access etc. Examples will make this clearer.
 
Sub Namespace
In this tutorial we will study about sub namespace in PHP, how to declare namespace in PHP, how to access etc. Examples will make this clearer.
 

Related Tags for Namespace in PHP:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.