php - Strict Standards: Non-static method -
i'm running ubuntu + php 5.4 , got such error:
strict standards: non-static method xtemplate::i() should not called statically, assuming $this incompatible context in ... on line 339
and method looks this:
interface itemplate { public function i(); } class xtemplate implements itemplate { public function i() { ... } }
and code running normal on windows 7 in xampp. have found advices turn off error_reporing, need solve it. need install modules on turn on other settings in php.ini ?
you getting error message because calling function statically instead of creating instance of xtemplate class. depending on situation, either make function static:
static public function i() { ... }
or first create instance of xtemplate:
$myxtemplate = new xtemplate(); $myxtemplate->i();
i hope answers question.
edit: this page may interesting you.
Comments
Post a Comment