Is PHP Object-oriented?

后端 未结 7 1587
鱼传尺愫
鱼传尺愫 2021-01-30 03:09

Is PHP an object-oriented language? If not, then what about the framework CakePHP? Is it an object-oriented MVC implementation of PHP?

Also, can a PHP application wholly

7条回答
  •  情书的邮戳
    2021-01-30 03:39

    For any language to be classified as Object Oriented it needs to adhere to at least 3 principles of OO: Inheritance, Polymorphism, and Encapsulation. I don't know PHP and I have never used it before but if it at least meets these 3 principles then it is OO otherwise it is not. My suggestion is to search for how PHP supports, or not, each principle. Developers tend to be overly attached to the language they currently use and often are misguided and biased. Take for example the person stating that C++ isn't an object orient programming and yet receiving many thumbs up! This person could not be further from the truth yet his answer appears to be correct to many!

    So I did a bit of digging around and it seems that PHP5 supports these 3 principles!

提交回复
热议问题