All,
I'm using PHPLint to evaluate a PHP script I'm writing, and it returns the following error:
"ERROR: property `SimpleXMLElement::$error' does not exist or not visible".
The code referred to looks like this:
$this->_xmlResponse = new SimpleXMLElement($resultString);
if (($this->_xmlResponse !== NULL) && ($this->_xmlResponse->error))
And _xmlResponse is a class variable declared like this:
private /*. SimpleXMLElement .*/ $_xmlResponse = NULL;
The way the SimpleXMLElement class works is you refer to an XML element by name using the -> operator. So I'm referring to the "error" element from my SimpleXMLElement object.
I am also getting errors like this one:
ERROR: `->' operator applied to a value of type mixed
When accessing elements like this:
print ' by ' . htmlentities($status->user->screen_name) . '</h6>';
The code works fine, but PHPLint still gives the errors. I've looked through the PHPLint reference manual but I can't figure out if PHPLint is unable to parse SimpleXMLElement, or if this is really something that is a potential problem. Can anyone explain this PHPLint error? Perhaps there is some type casting I need to do?