Re: Getting static member for a class which name is stored in a variable
| From: | Jake Press | Date: | Sun, 28 Nov 2004 07:56:05 +0000 |
| Subject: | Re: Getting static member for a class which name is stored in a variable | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-202990@lists.php.net to get a copy of this message | ||
Simas Toleikis wrote:
Jake Press wrote:Umm, it is an unclear syntax limitation, which is a bug. ... either language or manual. i understand what you are saying, i beleive i disclaimer'd my own examples somewhere down the line in those threads ;) i beleive there should be a better way to do this without: - using reflection - instantiating the class and using a method to retrieve the variable - eval Also please notice the existance of the "call_user_func" and what this gives us ;) = this gives us a solution (workaround??) to access static functions within a class Perhaps we need a similar function to provide access to our static variables! :) Best Regards Jake PressHi Francisco, Your not alone, a number of other users have enountered this bug.string get_class ( object obj ) Its not a bug... You are getting class name as a string for output purposes etc.. Doing something like "TestClass"::some_static is ofcourse illegal wih strings. Morning,