Jaybill McCarthy schreibt in seinem Blog über 10 Gerüchte um PHP und erklärt warum diese nicht zutreffen.
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 method overrides, but there are ways around this. Late binding is still a bit immature. 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.
…und hoffentlich wird die OO weiterhin verbessert die wir dann in PHP6 verwenden werden. Zu diesen Verbesserungen zählen sicher namespaces an denen konkret gearbeitet wird, wie auch die Unicode-Unterstützung.
Also false. Is there a lot of sloppy PHP code around? Absolutely. PHP’s low entry barrier means that a lot of people who aren’t formally trained developers get in over their heads. The sloppy code that results is a result of poor training and bad management, not the language itself. Saying PHP encourages sloppy code is like saying hammers encourage bloody thumbs. Sure, you can bang your thumb with hammer, but is that the hammer’s fault or yours for not knowing how to use it correctly?
Das ist leider tatsächlich ein Punkt wo viele “Entwickler” den Ruf von PHP geschädigt haben und zu diesem Gerücht beigetragen haben. Natürlich ist die Sprache gewachsen und hat einige Altlasten aus PHP3 Zeiten mitgenommen(/mitnehmen müssen) um nicht mit der Kompatibiliät zu brechen. Fakt ist aber das es mit PHP absolut möglich ist guten und sauberen Code zu schreiben. Wenn man sich auch etwas mit der Sprache an sich ein wenig beschäftigt.