Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-15-2008, 05:52 PM   PM User | #1
kaisellgren
Regular Coder

 
Join Date: Jan 2006
Location: Finland, Hollola
Posts: 285
Thanks: 8
Thanked 0 Times in 0 Posts
kaisellgren is an unknown quantity at this point
Non-static method X should not be called statically?!

Hello,

I am having this error suddenly out of the blue:

Code:
Non-static method SpawConfig::getStaticConfigItem() should not be called statically, assuming $this from incompatible context
I'm using www.spaweditor.com in my PHP 5.2 website. My error reporting is set so that it does not display E_STRICT errors:

PHP Code:
if (substr(phpversion(),0,1) != '6')
 
error_reporting(E_ALL);
else
 
error_reporting(E_ALL & ~E_STRICT); 
by _Aerospace_Eng_ from: http://codingforums.com/showthread.php?t=139835
__________________
PHP 5 & MySQL 5 (Y)
kaisellgren is offline   Reply With Quote
Old 05-15-2008, 07:21 PM   PM User | #2
derzok
Regular Coder

 
Join Date: May 2008
Location: Ohio
Posts: 231
Thanks: 3
Thanked 21 Times in 21 Posts
derzok is an unknown quantity at this point
Something tells me that you should ask the people at spaweditor.com - they would know their code a lot better than we would.

On a high level: A static method is a method that works on the class as a whole, not an instance of the class. Like in Java how you can have a Math object so that you can call Math.pow(2,4) (calculates 2^4). It would be silly to have to instantiate the math object just to do powers - instead you can call it independently of the object. What that error implies is that you have a class that has a static method. The static method is calling a function that is associated with an instance of the class, not the class itself. That would be like if Math.pow required an instance of the Math class to be instantiated.
derzok is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:53 AM.


Advertisement
Log in to turn off these ads.