php - Within a class: Calling a function with a function -
when utilize code below, error:
fatal error: phone call undefined function passwordhash() in c:\(...)\index.php on line 38
if $something = new accountcreation;
and phone call via $somethingn->passwordhash();, i'm able phone call function.
but, how phone call function way want to, within class? (see function: callmethods();)
thanks.
class accountcreation { function __construct($passwordcreation, $usercreation, $ipcreation, $emailcreation, $con) { $this->passwordcreation = $passwordcreation; $this->usercreation = $usercreation; $this->ipcreation = $ipcreation; $this->emailcreation = $emailcreation; $this->con = $con; } function callmethods() { passwordhash(); } function passwordhash(){ $this->passwordcreation = password_hash($this->passwordcreation, password_bcrypt); var_dump($this->passwordcreation); } }
how $this->passwordhash()
? :) in comparing c++ you'll have explicitly name this
/$this
.
php class methods
No comments:
Post a Comment