How to learn OOP PHP easily?

jason223

New member
Registered
Joined
Sep 1, 2017
Messages
9
Points
0
I am struggling learning OOP in PHP. I know how to code procedural but it's hard for me to learn OOP. Any tips and any tutorial recommendation? Thanks in advance!
 

flamehotter10

New member
Registered
Joined
Sep 6, 2017
Messages
5
Points
0
What is OOP?
OOP stands for Object Oriented Programming. OOP is a programming paradigm wherein you create "objects" to work with. These objects can then be tailored to your specific needs, to serve different types of applications while maintaining the same code base. Quite useful indeed.

What is an object?
An object is simply a copy or instance of a "class". A class can be defined as a "black box" from where we create our objects and access its attributes (variables) and methods (functions). The most common analogy given when explaining classes and OOP is how you drive a car: basically, you have 2 or 3 pedals, a gear stick and a steering wheel. You don't need (and most probably don't want) to know how the car works when you press the pedals. You just want your car to go back and forth, left and right. And OOP is precisely that. You don't need to know how the methods of a class work (if you didn't implement it yourself), just what they do. OOP is also useful if you have a large number of objects of the same type in a system: you just have to create the objects and then manipulate them all in the same way, without rewriting any code. Moreover, an object is able to maintain it's state (variable values and such) throughout the execution of the program.
 

radwebhosting

Well-known member
Hosting Provider
Registered
Joined
Jan 14, 2016
Messages
312
Points
28
Some very good (and FREE!) php resources can be found on killerphp.com and phpenthusiast.com, the latter offering some nice practice sessions, which can really help with building familiarity and skill. Both websites tackle Object Oriented PHP (I checked :rolleyes2:) in great detail.

Good luck to you in your programming studies and web development endeavors!
 
Older Threads
Replies
3
Views
1,899
Replies
2
Views
1,761
Replies
4
Views
1,912
Replies
0
Views
1,492
Recommended Threads
Similar Threads
Replies
12
Views
2,355
Replies
4
Views
1,467

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top