News Feed
Sections




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

David Coallier's Blog:
PHP Namespaces (Part 1 Basic usage & gotchas)
August 20, 2007 @ 15:12:00

David Coallier has posted his look at the namespace support that will be included with PHP6, specifically some examples of their basic usage and things to look out for when using them in your applications.

Well, PHP has namespaces now! Time to start educating people on that long awaited feature and for the people that already do know namespaces from C++, you also need to read this, it's simple, but will give you the basic syntax.

He starts with things like "what is a namespace?" or "what are they used for?" before getting into the syntax. The next step up is explaining how they work - he uses an example project, ProjectOne, with its namespace definition and an example script (invoke.php) that uses this class (including the new "import" keyword and the double-colon namespace separator).

0 comments voice your opinion now!
namespace basic usage gotcha definition example namespace basic usage gotcha definition example


blog comments powered by Disqus

Similar Posts

Kevin Schroeder's Blog: My first stab at the Dependency Injection Container in Zend Framework 2

Community News: phpMyID (formerly myOpenID) Beta 0.3 Released

Edd Mann: Tuples in PHP

Jacob Santos' Blog: phpBB is Dead, Long Live FUDForum (or at least SMF)

David Coallier's Blog: PHP Namespaces (Part 1: Basic usage & gotchas)


Community Events





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


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

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