figmented Posted September 11, 2008 Share Posted September 11, 2008 I need to point a variable to a class using the scope resolution operator. I use the following to point a var to a class using the method operator: $className = 'Users'; $className->getAll(); This works but when I try: $className = 'Users'; $className::getAll(); ...I get the Hebrew error "unexpected T_PAAMAYIM_NEKUDOTAYIM" which means "unexpected double colon" Does anyone know how to do this and/or if this is possible? Thanks! Best, Christopher Tate www.figmented.com Quote Link to comment Share on other sites More sharing options...
448191 Posted September 11, 2008 Share Posted September 11, 2008 No ALL CAPS. I'll change it this time, but next time I'll just lock it. To answer your question, only way this is possible is with call_user_func or call_user_func_array (or Reflection, but lets not complicate matters). Quote Link to comment Share on other sites More sharing options...
figmented Posted September 11, 2008 Author Share Posted September 11, 2008 sorry about that. this function worked perfectly. thank you so much! Quote Link to comment Share on other sites More sharing options...
448191 Posted September 11, 2008 Share Posted September 11, 2008 You're welcome. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.