Fairly new to classes in PHP, so bear with me.
class processRoutes
{
//Next line works
private $doc = "works as as string";
//Next line does not work, "Parse error: syntax error, unexpected T_NEW"
private $doc = new SimpleXMLElement('routingConfig.xml', null, true);
private function getTablenames()
{
//do stuff
}
}
I'm trying to ultimately utilize the SimpleXMLElement object within my class, among several private functions. What is the correct method for going about this, and why doesn't my current method work?