Tell me in php, what are magic methods and how are they used?
Answer / Kumar Aman
Magic methods, also known as 'magic functions', are special PHP functions that automatically trigger when certain events occur. Magic methods begin and end with double underscores (__). Some examples include: 1) __construct(): runs whenever an object is instantiated. 2) __destruct(): runs right before the script ends or an object is destroyed. 3) __get($name): automatically generates a method to access public properties when they are called by their property name.
| Is This Answer Correct ? | 0 Yes | 0 No |
How do I install https?
How do you clear your browser?
What is the difference between tags and categories?
Are wordpress passwords salted?
Why should I use wordpress for my website?
Tell me what is the simplest way to find out the number of parameters passed into a function?
What is a topic tag?
How do I create a wordpress template?
Do I own my wordpress domain?
How do you set categories in wordpress?
Would you initialize strings with single quotes or double quotes?
What is plugin? List some important wordpress plugin?