user185631
user185631

Reputation: 1323

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 exist. Previous calls (they're all static - not my choice) earlier in the code worked.

Upvotes: 2

Views: 830

Answers (2)

Anze Jarni
Anze Jarni

Reputation: 1157

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?

Upvotes: 0

gaRex
gaRex

Reputation: 4225

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?

Upvotes: 1

Related Questions