I know you can do: $hash('foo') and $$foo and also $bar[$foo], what are each of these things called?
I know you can do: $hash(‘foo’) and $$foo and also $bar[$foo] , what are
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.
$hash('foo')is a variable function.$hashmay contain a string with the function name, or an anonymous function.$$foois a variable variable.$foomay contain a string with the variable name.$bar[$foo]is a variable array key.$foomay contain anything that can be used as an array key, like a numeric index or an associative name.The PHP manual has an article on variable variables, and an article on anonymous functions (but I didn’t show an example above for the latter).