Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • What are magic functions?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 122
    Comment on it

    PHP have some magic methods that you can use in OOP (Object Oriented Programming). All the magic functions must be identified with twice underscores (__) prefix and they work as interceptors that will run when certain required conditions are met.

    Following are some magical functions in PHP listed below:

    a) __construct()
    b) __destruct()
    c) __call()
    d) __callStatic()
    e) __get()
    f) __set()
    g) __isset()
    h) __unset()
    i) __sleep()
    j) __wakeup()
    k) __toString()
    l) __invoke()
    m) __set_string()
    n) __clone()



    Magic methods are always defined inside classes, and are not stand-alone (outside of classes) functions.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: