tags:

views:

77

answers:

2

With the introduction of Object-Oriented and Namespacing capabilities in PHP, I am loving the new found cleanliness of PHP code that can be produced. The annoying thing though is that the core of PHP is still cluttered, unorganized mess of functions.

Are there any initiatives to organize the PHP core and "common" libraries into namespaces and classes?

A: 

There's been some discussion, but no real will -- the PHP dev team is too short for the size of the project and there are other priorities. You should note that it that would break backwards compatibility with older scripts, even if the current global names are left as is. See here.

You might want to see the RFC that proposes the use of namespaces for internal classes and its discussion in the internals mailing list here and here.

Artefacto
+1  A: 

SPL is a good start in this direction.

http://php.net/manual/en/book.spl.php

That's a great point. SPL is one of those things that I hear about and forget just as quickly. If using SPL doesn't hurt performance noticeably, it'd be great for the online docs to reference them more so that people get accustomed to using them. (granted, that's a community effort, not a core team effort)
James Maroney
We do need to raise awareness. The docs should really reference SPL.I will make a point to add comments in the manual whenever I see an appropriate spot.Also good to know:CakePHP 2.0 will implement SPL.I've just found the complementary library SPL Types, which is an (experimental) attempt to strong-type the language. http://www.php.net/manual/en/book.spl-types.php