Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8767519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:50:09+00:00 2026-06-13T16:50:09+00:00

Users.php (model): … public function hashPassword($password){ $hashed = hash(‘sha256’, $password . self::HASH_CODE); return $hashed;

  • 0

Users.php (model):

...
public function hashPassword($password){
    $hashed = hash('sha256', $password . self::HASH_CODE);
    return $hashed;
}
...

UserIdentity.php

...
else if($user->password!==Users::hashPassword($this->password))
...

Error:

Non-static method Users::hashPassword() should not be called statically, assuming $this from incompatible context
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:50:11+00:00Added an answer on June 13, 2026 at 4:50 pm

    You’ll need to define hashPassword() as a static function in order to call it with Users::hashPassword():

    public static function hashPassword($password) {
        ...
    

    Otherwise, you can create an instance of the Users class and call it in a non-static manner:

    $users = new Users();
    $users->hashPassword($password);
    

    In a strictly-yii sense, you may be able to call it with the following (depending on your setup):

    Yii::app()->Users->hashPassword($password);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i created a model object in PHP class User { public $title; public function
Model function public function getUserByID($id) { $q = $this->db->get_where('users', array('id' => $id), 1); $user=
First of all I have a Model user.php which connects to users table. I
make /bin/sh /Users/myusername/Downloads/php-5.3.5/ext/mssql/libtool --mode=compile cc -I. -I/Users/myusername/Downloads/php-5.3.5/ext/mssql -DPHP_ATOM_INC -I/Users/myusername/Downloads/php-5.3.5/ext/mssql/include -I/Users/myusername/Downloads/php-5.3.5/ext/mssql/main -I/Users/myusername/Downloads/php-5.3.5/ext/mssql -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM
I'm creating an online game in PHP where users can create playable characters. Each
What is the best way to handle mysql database users connection in PHP? I
Users call a web service API in my PHP code but don't properly encode
my php scripts usually send mail with users data to a mailbox on my
Language: PHP I have a form which asks users for their educational details, course
Using the PHP sdk I'm signing users into my site with Facebook log in.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.