If I use magic methods. While using reflection API, I can’t investigate class properties.. Why is it so?
EDIT
What is Reflection API? pls do not refer me php.net i didnt understood that.. guide me in your words plsss
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Using magic methods to access properties, those properties will generally not be present in the class’ definition.
Your class’ definition will generally look like this :
As there is no real properties — there is on only a
$dataarray, which will be used by the magic methods__getan__setas a big data-store — those cannot be seen by the Reflection API.That’s one of the problems caused by using magic methods : they are used to access properties (or methods, with
__call) which are not there — and the Reflection API can only see what’s there.