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
PHP doesn't force you to declare you class properties but will create them for you when first accessed. Whether this is good or bad, be that as it may, welcome to PHP.
Another thing to check is that you don't have any inheritance happening. Was your $dbh
property defined in a parent class? There isn't anything in the simple code you posted but I can imagine that you simplified a bit for public consumption. :-)