saurabh  singh
In PHP, what are magic methods and how are they used?
By saurabh singh in PHP on Mar 18 2015
  • Roshan Rathod
    Jul, 2020 19

    Magic Methods:
    The function names construct(), destruct(), call(), callStatic(), get(), set(), isset(), unset(), sleep(), wakeup(), serialize(), unserialize(), toString(), invoke(), set_state(), clone() and __debugInfo()
    are magical in PHP

    • 0
  • saurabh  singh
    Mar, 2015 18

    PHP functions that start with a double underscore – a “__” – are called magic functions (and/or methods) in PHP. They are functions that are always defined inside classes, and are not stand-alone (outside of classes) functions. The magic functions available in PHP are: __construct(), __destruct(), __call(), __callStatic(), __get(), __set(), __isset(), __unset(), __sleep(), __wakeup(), __toString(), __invoke(), __set_state(), __clone(), and __autoload().

    • 0

Most Popular Job Functions


MOST LIKED QUESTIONS