+ 1

what if we don't write construct like in js?

5th Oct 2020, 2:31 PM
Abid Adhikari
Abid Adhikari - avatar
1 Answer
+ 3
If you do not write a constructor. It automatically uses an empty constructor. So you can do this class MyClass {} $myObj = new MyClass; echo $myObj instanceof MyClass; // true
5th Oct 2020, 2:46 PM
Ore
Ore - avatar