Weird PHP method behavior does not exist but is in code
Does anyone have a clue about this? PHP 5.2.13. Results not wholly consistent i.e. could get a good result with a page at one time, then get an error at another.
The error is fatal - class does not have method.
But the following are true:
The class is defined in only one place and has the relevant method in the code. At the point where failure occurs: reflection shows that the method exists. At the point where failure occurs: method_exists says the method does not 开发者_JS百科exist. Previous calls (they're all static - not my choice) earlier in the code worked.
May be it's related: http://bugs.php.net/bug.php?id=51425
But I think here we have some cache-related problem. Do you have some cache enabled? Like APC or any other accelerators?
Be sure that the file containing the method is included. If the method is in a class, make sure the class instance is created and the method is called through the class.
Maybe you are missing the class instance?
精彩评论