Reputation: 13940
This example (I need to extend DOMDocument
) shows the problem: var_dump(config)
returns NULL
(!), but there is an initialization.
class DOMxDocument extends DOMDocument {
public $X = 22;
public $config = array(
'a' => false,
'b' => true
);
public function __construct($newconfig=NULL) {
print "X={$this->X}\nY:";
var_dump($this->config); // NULL!!
parent::__construct("1.0", "UTF-8");
}
}
Upvotes: 2
Views: 58
Reputation: 225064
$config
is apparently used internally by DOMDocument
, whose constructor itself initializes it to NULL
.
Choose any other name.
Upvotes: 2