Jump to content

PHP Error


Hate

Recommended Posts

Hi,

 

I have two classes and there's no real reason to join them when I only need to access one function, so I'm just calling a function statically from my second class and I'm getting  this error:

 

Strict Standards: Non-static method unnamed::kpResults() should not be called statically, assuming $this from incompatible context in /test/objects/thread.class.php on line 27

 

The script actually works, but I still get that error with the Strict Standards. What do I do? :o

Link to comment
https://forums.phpfreaks.com/topic/213661-php-error/
Share on other sites

Well you could call the function static then you wouldn't get that error at all...

 

This is assuming as you are accessing it like this:-

 

if(!ClassName::YourFunction('params')){

//case true

}

else{

//case false

}

 

Either that, or just put the error_reporting(E_ALL) and not E_ALL|E_STRICT

 

That's just a work around though..

 

Rw

Link to comment
https://forums.phpfreaks.com/topic/213661-php-error/#findComment-1112078
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.