I am reading some PHP code that I could not understand:
class foo {
function select($p1, $dbh=null) {
if ( is_null($dbh) )
$dbh = $this->dbh ;
return;
}
function get() {
return $this->dbh;
}
}
I can't find $this->dbh ($dbh)
declaration from the class. My questions are:
What is the value of
$this->dbh
?Is it a local variable for function
select()
?Does
$this
belongclass foo
's data member? Why is there no declaration for$dbh
in this class?