Jaybill McCarthy Dispells 10 PHP Myths
Jaybill McCarthy has written an excellent blog post to open the year with, 10 PHP Myths Dispelled. In it he spends a paragraph on each of 10 myths about PHP and show why they are just not true.
Myth #1: PHP is not a truly Object-Oriented Language
I hear this one a lot from Java programmers. It’s completely false. PHP has excellent OO language facilities. There’s inheritance, abstract objects, interfaces, properties and methods. Okay, there’s no polymorphism. (Personally, I think polymorphism might be the worst idea ever, but that’s just my opinion.) I will say that there have been vast improvements in PHP’s OO mechanics with PHP 5, but I’ve written lots of PHP 4 apps that were totally OO. The mere fact that you can write purely procedural PHP code doesn’t mean that PHP isn’t OO capable. Furthermore, the fact that PHP allows you to mix OO and procedural code makes things like bootstrap scripts really simple.
He goes on to tackle topics like:
- PHP Encourages Sloppy Code
- PHP is slow because it’s interpreted
- PHP isn’t really for “serious” developers
Click on over to 10 PHP Myths Dispelled and give it a read.

Comments
However, I believe that the article should be changed to "10 PHP Myths that Novice Programmers Make". No self respecting developer would really believe in any of these myths.
There exist many object-oriented languages that also have native data types. Another way to say it is: a language 'supports' object-oriented programming, which PHP 5 does just fine. Any and all object-oriented programming one wants to do, and any object-oriented design patterns one wants to implement, can all easily be accomplished with PHP 5.
There are a few languages where every single piece of data or variable is an actual object internally to the language, like SmallTalk, but that doesn't mean that other languages (that have native data types that aren't actual objects) don't allow programming in a fully object-oriented way, including Java, PHP 5, C++, and many others.
"e.g. Strings [are not] objects ([or you could] do e.g. "this".doSomething() in PHP )."
The unstated assumption is that in order for a language to be considered "object-oriented", all data structures must be objects.
This is academic nonsense. Not even Java or .NET have primitive types that are objects* -- are they not object oriented either?
According to Wikipedia (and any sensible programmer), "Object-oriented programming (OOP) is a programming paradigm that uses 'objects' and their interactions to design applications and computer programs."
PHP is perfectly capable of this programming paradigm, and as such, can be considered "object-oriented".
If it really upsets you so much that certain primitive types are not also objects, write a String wrapper class and use that instead.
*Java and .NET both have autoboxing, which will transparently convert primitive types to their corresponding wrapper objects, allowing you to interact with them as if they were actually objects. But this has not always been the case. Before autoboxing, would you claim that Java was not object-oriented? Absurd!
Logic, such as stated in this top 10 list, is often not enough to overcome the ignorance. I believe there are an unfortunate number of companies that spend too much time and money going with another language when PHP really would be the most effective choice.
I recently dealt with a department sys-admin of a state University that simply wouldn't install/support PHP on their servers because "it's not secure". All the while their peers in other departments have embraced PHP and are obviously the better for it. Frustrating...
The problem is, is that many of these myths the original author comments on are real and run rampant in forums, blogs and what not and promote the stigma that PHP endures. The easy integration of PHP with web servers, while technologically fantastic, allows for novice/amateur developers to dabble in programming and push horrible production code out. I've personally taken over many PHP projects that are filled with junk, spaghetti code that was developed by "professional" programmers.
It's not the inherit fault of the language; however, it unfortunately takes the brunt. If Java were as easily as accessible, the same conceptions would be had with Java.
I agree that PHP is an effective choice with the advent of PHP5 these days. Coming from a very strong Java background, I believe that a large percentage of Java applications out there could easily have been done more effectively in PHP.
As for insecurity in PHP, security in web applications falls fundamentally first and foremost in the hands of the developer. Without a competent developer, security bugs will be in any language.