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 53 times
0

Praveen Kumar Purushothaman
- 164,888
- 24
- 203
- 252

Danyl Filatov
- 111
- 1
- 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