Shiroyuki Shiroyuki - 1 month ago 4
PHP Question

How to get a static function into a non static funtion?

Well Hello,
my problem is that i get this message when i register my account. (It works but that little message is a abit ugly.)
http://puu.sh/s68QK/d6ffc5b57c.png
I'm not really familar with static and non static so I'd like to ask how to get this

$password = Password::encode($password);
(line 76)
into a non static version.
Thank you

Answer

This warning what you got means that encode is not a static method. It should be called more like this:

$pass = new Password();
$password = $pass->encode($password);

Static function looks like follows:

private static function encode($pass) { 
...
}

Non static looks like this:

private function encode($pass) { 
...
}

More informations can be found here

Comments