Great article, Justin.

Just wanted to add a note regarding constants and namespaces. You actually can use the define function to create a namespaced constant; you just have to indicate the namespace (thanks, magic constants!) For example, the following two lines create an equivalent, namespaced constant.

[code lang=text]
const MY_CONSTANT = 'some value';
[/code]

or

[code lang=text]
define(__NAMESPACE__.'\MY_CONSTANT', 'some value');
[/code]

...notably, the const declaration cannot use functions on the right side of the operand... you can still concatenate a string, but, no functions. Conversely, using the define() function, does allow you to use functions on the right side of the operand.

Cheers!