Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have this function:

<?PHP
function T($w) {
    $method = $GLOBALS['G_SP']["lang"][spController::getLang()]; // LINE 2
    if(!isset($method) || 'default' == $method){
        return $w;
    }elseif( function_exists($method) ){
        return ( $tmp = call_user_func($method, $w) ) ? $tmp : $w;
    }elseif( is_array($method) ){
        return ( $tmp = spClass($method[0])->{$method[1]}($w) ) ? $tmp : $w;
    }elseif( file_exists($method) ){
        $dict = require($method);
        return isset($dict[$w]) ? $dict[$w] : $w;
    }else{
        return $w;
    }
}
?>

no i see this error in line 2:

Strict Standards: Non-static method spController::getLang() should not be called statically in C:\xampp\htdocs\inc\spFunctions.php on line 2

how to fix this error?

NOTE : i need to fix this without change php.ini (disable error_reporting = E_ALL | E_STRICT OR display_errors = On to Off)

share|improve this question
have you verified that you are calling the method properly? from the error it seems that you should have an instance of spController and call getLang() from it instead of calling it as static. – Pawel J. Wal 6 mins ago

1 Answer

$sp = new spController();
$sp->getLang();

Or maybe an instance of spController already exists from somhere in your application

share

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.