PHP scripts register.php:
$compareUser = new User();
$user = new User;
verify.php (executes with a link from register.php, passes two variables to User.php)
User.php
setActive($token, $uid){
$this->username = /????
}
*assuming that User has a username property, which instance of the User class will $this take? $compareUser or $user?
$this
is context-sensitive - it always refers to the current context in which code is running.It is not possible to refer to
$this
unless you call it from within a (non-static) class method. When you do,$this
refers to whichever instance of the class invoked that method upon run-time.