Course lesson
Run code on PHP class creation with a constructor
It's very common to execute a piece of code when an object is created. In this lesson, you'll learn how to do just this with a PHP class constructor.
- Duration
- 2 min
- Access
- Included
- Transcript
- Retained from source evidence
It's very common to execute a piece of code when an object is created. In this lesson, you'll learn how to do just this with a PHP class constructor.