[wp-hackers] WordPress moving to PHP 5.3x?

scribu mail at scribu.net
Tue Jul 17 00:08:08 UTC 2012


On Tue, Jul 17, 2012 at 2:21 AM, scribu <mail at scribu.net> wrote:

> It just dawned on me that with PHP 5.3 namespaces, I wouldn't need to do
> these crazy hacks to have a common set of functions bundled with each
> plugin. I could just load them under that plugin's namespace only.
>

Turns out what I was thinking about isn't possible with PHP namespaces:
*
*
*<?php

namespace MyPlugin;

require 'my-framework.php';*

Unless my-framework.php also has the *namespace MyPlugin;* declaration, all
it's functions will still be loaded in the global namespace.

PHP 5.3, still a fractal of bad design.

-- 
http://scribu.net


More information about the wp-hackers mailing list