gonefishin
12-06-2010, 07:24 AM
I'm relatively new with PHP, database and web apps.
After studying the language a bit, I noticed that PHP seems to encourage the procedural style although it gives you nearly 100% OOP functionality. Also from my understanding of how PHP works, I don't really see the need for OOP.
When a user logs in to your PHP app, a new session is automatically started. The variables and data in that session are automatically encapsulated / protected from other sessions. Its not easy to share data between sessions. So in a more traditioanl language, these sessions are like objects. Each user accessing your PHP program through the web server is like a new object.
Also, PHP has a whole slew of built in functions and these functions are not divided into classes or frameworks. There is no versions / extensions or polymorphed built in functions...
Also from what I understand, event listening and multi-threading isn't natively possible on PHP. Of course event monitoring and threading were two big reasons for OOP.
So I'm still planning to use OOP for PHP because it seems to be well supported. And there are other features in OOP such as extensibility (when planned right) and OOP forces you to name and organize everything properly.
So just wondering how many of you OOP with PHP?
After studying the language a bit, I noticed that PHP seems to encourage the procedural style although it gives you nearly 100% OOP functionality. Also from my understanding of how PHP works, I don't really see the need for OOP.
When a user logs in to your PHP app, a new session is automatically started. The variables and data in that session are automatically encapsulated / protected from other sessions. Its not easy to share data between sessions. So in a more traditioanl language, these sessions are like objects. Each user accessing your PHP program through the web server is like a new object.
Also, PHP has a whole slew of built in functions and these functions are not divided into classes or frameworks. There is no versions / extensions or polymorphed built in functions...
Also from what I understand, event listening and multi-threading isn't natively possible on PHP. Of course event monitoring and threading were two big reasons for OOP.
So I'm still planning to use OOP for PHP because it seems to be well supported. And there are other features in OOP such as extensibility (when planned right) and OOP forces you to name and organize everything properly.
So just wondering how many of you OOP with PHP?