I have tried to find this out, but in vain. 🙂
Tell, PHP is a scripting or object oriented language and how u will proof it.
Thanks.

    PHP could be considered scripting because it's not compiled, it's interpreted. But I'm sure many here will agree that it's object oriented, because of it's use of classes and functions and etc. Plus I think the new PHP 5 has better support for classes, including public/private vars.

    And I don't think Weedpacket will answer 😃

    Or did you mean "procedural" by scripting?

      PHP does get compiled and cached if your rig is set up for it. I came from a C++ background before php and consider php to be definitely object orientated, even php4.

        Drakla wrote:

        PHP does get compiled and cached if your rig is set up for it. I came from a C++ background before php and consider php to be definitely object orientated, even php4.

        Operative word is "if". Most webservers aren't set up like that. Mine isn't 😉

          LoganK wrote:

          But I'm sure many here will agree that it's object oriented, because of it's use of classes and functions and etc.

          It is pseudo object oriented because PHP doesn't support overloading or overriding functions.

            Because many coders, even many who have used a true object-oriented language such as c++, don't know what the term means, PHP has come to be called "object-oriented" simply because it has classes. But, for the reasons benkillin cited and others, such as the lack of multiple inheritence, it's not. You can't do true OOP with PHP. Being compiled or not, or scripted or not, has nothing to do with it.

              Object-oriented programming is a programming paradigm. You can do OOP in C if you want - you could do it in INTERCAL if you want; it's nothing to do with what constructs are allowed or not (and multiple inheritence is hardly a perquisite, C++ is about the only language that does have that) - those just decide what is easier and how you would go about implementing an OO-structured program.

              Either way; whether PHP is object-oriented or not has nothing to do with whether it is a scripting language or not. Just as whether Gyuniku Sashimi is a main course or not has nothing to do with whether it is Japanese or not.

              PHP is not a language based on object orientation. It is based on the procedural (or imperative) paradigm, and word from On High (i.e., Zeev) is that it will stay that way. It just provides OO constructs for those who want to use the OOP paradigm.

              Whether it's a scripting language or not: I think the distinction is bogus.

                it's nothing to do with what constructs are allowed or not

                True, in the current vernacular.

                  "In the current vernacular"? You mean there is a formal definition that does specify which constructs must be provided (and which manages to rule out virtually every so-called OOP language except C++)? I have to say I've never come across it. The only definitions I've seen are those like

                  http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=OOP

                  Still, the original question as asked is meaningless due to a category error.

                    Weedpacket wrote:

                    Still, the original question as asked is meaningless due to a category error.

                    This reminds me of Aristotle's list of logical falacies. And I agree, the question is not valid. It would be like asking: "are cats fuzzy OR are they mammals and can you prove it?" Because if we admit one, we deny the other. However, if the question was: "are cats fuzzy AND mammals?" then it would be logically valid.

                    (I think it is rather rude to pose questions like that.)

                      OOP in PHP, is like stabbing yourself in the face with a fork. I am waiting on Larry Ullman's PHP Advanced 2nd edition so I can understand it. He is certainly the best author ever.

                        How'd we get to philosophy from OOP PHP? 🙂

                          Weedpacket wrote:

                          "In the current vernacular"? You mean there is a formal definition that does specify which constructs must be provided (and which manages to rule out virtually every so-called OOP language except C++)? I have to say I've never come across it. The only definitions I've seen are those like

                          http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=OOP

                          Still, the original question as asked is meaningless due to a category error.

                          I don't have the original quote handy, but if you want to know what OOP really is, go find Alan Kay's talks about Smalltalk. He "coined" the term OOP, and if anyone can answer it, it would be him. IIRC, he tends to avoid putting a true meaning to it for obvious reasons.

                            Write a Reply...