News Feed
Sections




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

php|architect:
PHP 5.3 namespaces for the rest of us
March 30, 2010 @ 11:45:48

On a new post to the php|architect site today Giorgio Sironi takes a look at namespaces in PHP from a beginner's perspective.

According to the official documentation, PHP namespaces have been designed to prevent name collisions between classes from different packages and to avoid the use of very long names in the code to refer to classes or functions. [...] This means that namespaces help a developer write code that is both more concise and clearer - a direction which is always an improvement towards expressiveness.

He gives an example of how to define them in your application (using the "namespace" operator), how they work on a bit more detailed level and a few exceptions you'll need to watch out for. He also talks about importing other classes into namespaces and how you can use the dynamic loading of classes right beside the namespace functionality.

0 comments voice your opinion now!
namespace tutorial introduction


blog comments powered by Disqus

Similar Posts

Matthew Weier O'Phinney: ZF2 Modules Quickstart (Screencast)

PHPMaster.com: Creating a Mobile Photo Blog, Part 1

The Bakery - Rails-Like Validation, Elistic, Textile, and a CakePHP Release

Matthew Weier O'Phinney's Blog: Taming SplPriorityQueue

Zend Developer Zone: Tutorial : Using Zend Framework Without PDO


Community Events





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


composer release voicesoftheelephpant application opinion symfony package podcast tool framework interview introduction install version community library laravel language series security

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