Interfacing in the PHP World – Dictator Style

Seems that I have a radical approach to the need for PHP interfacing as suggested by Lucas Smith ( then a rebuttal by Herman Radtke ( and finally Lucas Smith again (

I think that the approach for PHP should be:

1) Interfaces in the main PHP tree therefore all have to abide or die, that is how Java gets its notoriety. The SPL was a good start, so now let us spread the love to the rest of the core

2) Else start something like Apache Commons for Java which is the Switzerland, and allows drag and drop or reference implementations. However this is also difficult if there are no common interfaces

3) PHP needs that kind of dictatorship that Java has in order to move forward – dictatorships move things forward (whether good or bad).

Why do I say so?

1. What is an interface – it is a contract for behavior, which means that irrespective of the implementation you will expect the same behavior, which enhances encapsulation and abstraction core object oriented design principles. This is critical as PHP needs to grow past its roots and become truly enterprise.

2. PHP has grown successful because it is simple, but with simplicity comes a price which affects how the future looms. While PHP does not need a JCP like community process (3 – 5 years for Standards), it needs to have some form of commitees which advance different parts and aspects of the language which is now larger than the individual core developers. The interfaces mean that there is a reference implementation which is always followed by big vendor implementations – what PHP needs now are stable processes and standards for adding and managing features.

3. So how does this go, you cannot interface the whole language at a Go, however PHP’s object and procedural classes means that we gotta start from somewhere. And please do not go overboard, keep the interfaces simple and clean … I know there are issues like big vendor interests but they will have to sit together and work things out otherwise you will end up with people who will innovate over the language see Java’s Spring Framework (

4. Using the HTTP request/response classes I have only used the Zend Framework versions and not the Symfony 2 versions yet (in a few weeks), however I like the object oriented nature of those … but that is just me 🙂

In closing, we have to learn to pick the best parts of other languages in order to improve whatever we use .


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: