This is also known as overloading, but as that term means something quite different in Java and C++, I think it is better to talk in terms of interception. PHP supports various built-in interceptor or “magic” methods. Like __construct(), these are invoked for you when the right conditions are met.
| Method | Description |
|---|---|
| __get($property) | Invoked when an undefined property is accessed |
| __set($property, $value) | Invoked when a value is assigned to an undefined property |
| __isset($property) | Invoked when isset() is called on an undefined property |
| __unset($property) | Invoked when unset() is called on an undefined property |
| __call($method, $arg_array) | Invoked when an undefined nonstatic method is called |
| __callStatic($method, $arg_array) | Invoked when an undefined static method is called |
Dukung Saya supaya tetap menulis artikel-artikel yang baik, membayar sewa domain, dan server untuk blog ini. Caranya dengan donasi cendol via Trakteer.id.
Komentar: 0
Login untuk meninggalkan komentar