What is the overall design philosophy of php?

From the php web site:

PHP is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly.

In other words, there isn't really a design philosophy: It's a mix and mash of ideas to get a job done (obviously inherited from Perl, hehe).


The design philosophy of PHP:

D'oh!


PHP's emphasis is on getting the job done, quickly, not cleverness. That's not to say that you cam't write nice, clean, object-oriented code in PHP. I think that where most PHP programmers go wrong is in thinking that because you can embed PHP in HTML, that you must do so. My own PHP code is strongly object oriented and contains no embedded code at all (apart from the initial page).

And as you point out, PHP is very well documented, which is more than you can say for many of its competitors.


What you have to remember is that PHP was a revolution. At the time PHP was created by Rasmus Lerdorf there was really no alternatives for dynamic sites. Well there was CGI-GATEWAY (which php basically is) which involved writing your own C exe to serve pages - there was something called ASP but it was fairly rubbish back then and only ran on windows boxes which were very few and far between on the web.

You could say its reason to be or it design philosophy was that it was the first mass-market scripting language for the web. It wasn't so much designed as grown which is why it seems a bit of a mess, but it does the job.