PHP’s magic methods: Invoke, toString, get, set – Class wizardry in a nutshell. We’re on the last of the built in functions/methods that PHP has to offer. We’re nowhere close to the full extent of the built in functions that PHP offers, but I think we’ve covered the most frequently used ones. In this article, we’ll look at __invoke, __toString, __get and __set methods. PHP has a few “magic methods” like __construct, __destruct, __call, __callStatic, __get, __set, __isset, __unset, __sleep, __wakeup, __serialize, __toString, __invoke, __setState, __clone, and __debuginfo. We’ve already covered the __call, __construct and __destruct magic methods. trim(), ltrim(), rtrim() htmlspecialchars() __call()