Extract function of php adds variables to the local scope of the calling function. How can we write our own php function extract which does the same?
Extract function of php adds variables to the local scope of the calling function.
Share
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.
I don’t think you can do that in pure-PHP : a function doesn’t have access to the variables of its caller.
This looks like the sort of thing you’ll need to write a C extension to develop — you’ll have more control over the internals of PHP variables there.
(And I don’t really see why you’re trying to do that : why not just use the existing
extractfunction ? )