To learn object oriented programming in php: when and where?

So, I have been learning PHP for the past while, I feel like I am comfortable with most of the procedural language and want to move on.

I was wondering when you think it is a good idea to start learning OOP for PHP? and where to learn it from?

I am also reading about frameworks like cakePHP and codeigniter and wondering if it’s best just to learn a framework or if OOP is still necessary?

Thanks.

Hi stephenTMS,

First off there are many really good coders that never use OOP, so you will not necessarily be a better programmer by learning OOP, and in fact, many people that use ‘OOP style’ rarely leverage the power of OOP so they may be better to use procedural programming.

PHP has always been limited as a ‘full’ object oriented language compared to other languages; however don’t be put off by this as your applications can still benefit from using OOP methodology. The main concepts for OOP are Abstraction, Encapsulation, Modularity, Poymorphism, Inheritance and Composition. Recently with the release of PHP 5.4 has improved on these OOP handlers.

You would benefit by learning OOP; if you learn the proper OOP tenants then you will not be restricted to only using frameworks, or procedural programming techniques. However, you can at any time choose to use a framework or procedural programming should the situation that you face call for it. In addition, many other modern languages us OOP such as C++, C#, Javascript, and Java use OOP so if you ever learn to pick up a different language these skills can help do this more quickly.

Start learning as soon as possible as it will help you decide what framework you want to use. When looking at a framework don’t forget to also look at Symphony. As far as it goes Symphony has some of the best use of OOP programming under the hood - good to study how they do it.

Frameworks have taken a lot of the ‘thinking’ out of it for programmers, but truly it is nice to not get limited just because you choose to use a framework for some of your projects.

Regards,
Steve

Hi,
From my experience, i started to learn OOP after I have learned to work with variables, constants, arrays and functions.
Look on the net for “free php course”, “php classes tutorial”, and you’ll find resources to learn.