2 ms·
(From the alt text on the hyperlink where I said that): Yes, it has the 'class' keyword, but [it seems] that was bolted on relatively late and wasn't the prima
by moserware 16y ago
(From the alt text on the hyperlink where I said that):
Yes, it has the 'class' keyword, but [it seems] that was bolted on relatively late and wasn't the primary focus in PHP's design.
See the linked article: http://michaelkimsal.com/blog/php-is-not-object-oriented/ http://michaelkimsal.com/blog/php-is-not-object-oriented/
- mgkimsal 16y agoThat's my post, and I'll clarify a bit. I worked with numbers of people who all fawned over PHP5, some going so far as to (ignorantly) say "PHP4 didn't support classes". Of course it did - the class keyword was there, and I'd done a lot of OO work in PHP4 for many years. Yes, there's more class functionality in PHP5, but it's not on parity with some other languages. AND THAT'S OK. My beef was/is mostly with the term "object oriented". PHP as a language is not oriented about objects. Your apps can be, to a large extent, but the language is not oriented about objects the same way that Groovy or Ruby or Python is. And it shows. So.. embrace the function-based nature of PHP's core which allows you to build OO or procedural based on your needs. Just quit saying "PHP is Object Oriented" just because it's "Object Capable".
- Jach 16y agoPerhaps we should start applying "Object Capable" to other languages like C and C++ and the Lisp family then? I like your distinction (and your article) so you get an upvote but I don't really find it that useful other than for anti-marketing.
- mgkimsal 16y agoPersonally, I don't deal in those platforms, and I don't work with people trying to justify those other languages by claiming they're "object oriented". It was really just a semantic beef I had some time ago, and really would prefer people embrace the things about PHP which make it useful, rather than trying to sell it as something where it comes up short.