News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
PHP Namespaces
October 20, 2011 @ 09:24:47

One of the features that's recently been introduced into the PHP language has been a feature for keeping code not only more organized, but more modular - namespacing (PHP 5.3+). In this new tutorial from PHPMaster.com they introduce you to this handy feature and include a bit of code showing their use.

Namespaces were a long awaited feature in PHP. While many other important features were released with PHP 5, namespaces were not supported until version 5.3. This led to various techniques for emulating them which, though necessary, were messy and confusing. Although namespaces have been part of PHP for over a year now, such techniques still exist. Many developers simply don't know how to use proper namespaces in their code. In this article I will explain why namespaces are important and how you can use them in your own PHP code.

He starts off by talking about what namespaces are and how they can be used to segment up applications, especially larger ones, into more manageable chunks. Basic code is included showing how to implement a namespace, referencing items inside a namespace, the "use" keyword and the __NAMESPACE__ magic variable.

0 comments voice your opinion now!
namespace introduction tutorial why


blog comments powered by Disqus

Similar Posts

Eirik Hoem's Blog: Prado Framework 3.1.2 released

SitePoint Server-Side Essentials Blog: Keep Your Blog Safe: Back Up Your WordPress Installation

Andrew Podner: Intro to PHP Comments and Docblocks

DevShed: The Basics of Abstract Factory Classes in PHP 5

Anthony Ferrara: Iterators - Programming With Anthony


Community Events





Don't see your event here?
Let us know!


framework community composer conference unittest language api configure opinion interview laravel voicesoftheelephpant list threedevsandamaybe release symfony podcast version introduction series

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework