I have a PHP class that looks like this:
class userAuthentication
{
public static function Authenticate()
{
if (isset($_COOKIE['email']))
{
verify($someVar, getPass($_COOKIE['email']);
}
}
public static function getPass($email)
{
}
public static function verify()
{
}
}
At times (I can’t pin-point exactly when), I get a fatal error :
Call to undefined function getPass()
The error is thrown at the line where I call the function in the above code sample. Why is this happening when the function clearly exists.
It’s a static function in a class. Use
self::getPass()orstatic::getPass()if you want to take advantage of Late Static Binding. Same goes forverify().