1. CSS
  2. Flash
  3. HTML
  4. Illustrator
  5. Java
  6. JavaScript
  7. Maya
  8. Photography
  9. Photoshop
  10. PHP
  11. Ruby
  12. Ruby on Rails
  13. 3ds Max

PHP: PHP Class Tutorial – Part 3 – What Are Class Constructors?

  1. Clicks today:
    0
  2. Clicks this month:
    0
  3. Overall rating:
    5.00/5

PHP » Object Oriented Programming — about 7 years ago
So just what are class constructors, and how can they be used within PHP classes / OOP programming? When a PHP class is first called, the class will automatically run the class constructor function, which can help automatically configure the class. This can be useful if you need to preset some instance variables, sessions or cookies – prior to using the class methods.

Comments

Your Comment

You must be logged in to post a comment.