3 Ways to Access a Namespaced PHP Class

After what felt like years of debate over the notation to use for PHP’s namespaces, it seems like the feature itself has had relatively little use or attention since it was actually implemented in PHP 5.3. We’re all used to working without it but using it does make code neater.

Take this example (in a file called namespaced-class.php)

namespace Christmas\DaysOf;  

class PartridgeInAPearTree{ 
}

Now we have a few ways to access that class.

Continue reading