I'm just wondering why is __construct() called so. Why isn't it say just construct()? I mean maybe there's an interesting reason for that that only a few know because others didn't wonder. I'm sure that someone knows php good enough to explain that.
Asked
Active
Viewed 47 times
0
Praveen Kumar Purushothaman
- 160,666
- 24
- 190
- 242
Danyl Filatov
- 111
- 5
-
1Code ≠ Italics. `:)` – Praveen Kumar Purushothaman May 17 '17 at 20:51
-
See the second answer. – Praveen Kumar Purushothaman May 17 '17 at 20:52
-
2I assume you mean the `__`? That is a convention for _magic_ methods. Methods that are not called by the program or programmer but by the object when certain things happen. **PHP reserves all function names starting with __ as magical.** http://php.net/manual/en/language.oop5.magic.php – AbraCadaver May 17 '17 at 20:55