Content has been updated elsewhere, would you like to reload?

*** Warning: If you do not reload, you may be editing obsolete contents. This may cause you to lose recent changes.

Yes, reload    |    No, keep this older content
  • PHP "classes" and Object Oriented Programming might intimidate those of us used to procedural thinking. But it's only a conceptual shift. Once we compare classes to the blueprints of the house, and objects to the actual houses, PHP classes become easier to grasp and use.

  • This Web list collects the clearest introduction and examples we can find on the Web explaining the concepts and applications of PHP classes and objects. 

  Dishes  - Explanation & Examples
  • Dish 1 : Object-Oriented PHP for Beginners - Tuts+ Code Tutorial |

  • This is a very useful, step-by-step, and long tutorial for all the basics about PHP class and object. Stick with it, manually follow the tutorial and recreate the examples, so that you actually memorize the concepts. It's worht the effort!

    The topics include:

    • Understanding Object-Oriented Programming 
    • Understanding Objects and Classes 
      • Recognizing the Differences Between Objects and Classes 
      • Structuring Classes Defining Class Properties 
    • Defining Class Methods 
    • Magic Methods in OOP 
      • Using Constructors and Destructors 
      • Converting to a String
    • Using Class Inheritance 
      • Overwriting Inherited Properties and Methods 
      • Preserving Original Method Functionality While Overwriting Methods
    • Assigning the Visibility of Properties and Methods 
      • Public Properties and Methods 
      • Protected Properties and Methods 
      • Private Properties and Methods 
      • Static Properties and Methods Commenting with DocBlocks 
    • Comparing Object-Oriented and Procedural Code 
    • Reason 1: Ease of Implementation 
      • The Procedural Approach 
      • The OOP Approach
    • Reason 2: Better Organization 
    • Reason 3: Easier Maintenance 
    • Summary 

    A class, for example, is like a blueprint for a house. It defines the shape of the house on paper, with relationships between the different parts of the house clearly defined and planned out, even though the house doesn't exist.

    An object, then, is like the actual house built according to that blueprint. The data stored in the object is like the wood, wires, and concrete that compose the house: without being assembled according to the blueprint, it's just a pile of stuff. However, when it all comes together, it becomes an organized, useful house.


    As you can see, OOP keeps objects as separate entities, which makes for easy separation of different pieces of code into small, related bundles.

  • For many PHP programmers, object-oriented programming is a frightening concept, full of complicated syntax and other roadblocks. As detailed in my book, Pro PHP and jQuery, you'll learn the concepts behind object-oriented programming (OOP), a style of coding in which related actions are grouped into classes to aid in creating more-compact, ef

  • Dish 2 : Introducing PHP Classes - Codular |

  • Follow this tutorial to learn and review concepts. This tutorial is not as coherent as the first one above. The outline:

    • Introduction
    • Man + Woman = Person
    • Magic Methods
    • Singletons
    • Autoloading

    Working with classes in PHP is a great way to streamline your code, and make it awesome. Classes or object oriented (OO) programming are sometimes seen as behemoths of satan, but actually they're easy. Once you understand all the various levels of privacy, extensions and more recently magic methods. For the sake of simplification we'll be using PHP, and modelling a man and a woman as classes, with a few basic attributes of varying privacy levels.

    Man + Woman = Person

  • Object oriented programming is very powerful and is definitely something that should be used to keep maintainable code. Explore inheritance, privacy, magic methods and more inside
  Chops  - Further Details
  References and More

You are welcome to

  • Sign in through   Sign in or sign up with your Facebook account   Sign in or sign up with your Google account   Sign in or sign up with your Amazon account
  • Create your own Web list!
  • Save this into your reading list.
  • Write a comment below.
  • Share this Web list through email or with other Readish users.
Course info
3  2  0  4  0
Language: EnglishThis course is owned by Durio
By Durio

Suggested courses    Hide
  • Move to:
Open All         >>