title: Why does DOMXPath->evaluate() not return a typed result?
body: <p>Here is my code:</p>
  
  <pre><code>$label = $xpath-&gt;evaluate('./strong[1]/text()[1]', $div)-&gt;item(0);
  $value = $xpath-&gt;evaluate('./span[1]/text()[1]', $div)-&gt;item(0);
  </code></pre>
  
  <p>Both of these return a string. However, if I remove the <code>-&gt;item(0)</code> then it will return a DOMNodeList.</p>
  
  <p>This appears to not follow PHP's documentation of <code>DOMXPath::evaluate</code> which states:</p>
  
  <blockquote>
    <p>Executes the given XPath expression and returns a typed result if possible.</p>
  </blockquote>
  
  <p>Is there a way to change the query in <code>evaluate()</code> to directly get the text result I am seeking?</p>