Here is a small function I’ve growed to use when I built a WordPress plugin or site for myself. This could eventually be in core one day if WordPress would raise the minimum requirement of PHP to 5.3.

On a sidenote, we could also finally use namespaces…