As far as I know, class instantiation using a variable new $className(); is supported in 5.3 for sure, however I’m not sure about 5.2 version and I can’t check if this works OK on 5.2.
Can anyone tell what versions are supported?
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.
This isnt specific to PHP5. It will work in PHP4 as well.
See http://php.net/manual/en/keyword.class.php#99638