What I'm here to ask about is assigning custom member variables. When I do this:
Code: Select all
$dom = new DOMDocument();
$dom->silly = 'foobar';
print_r($dom);Code: Select all
DOMDocument Object
(
[silly] => foobar
)1. Is this a good idea? (I'm thinking of adding line number information and other data to nodes, which is why I need this)
2. Why don't any of DOMDocument's other, built-in properties show up when I print_r?