DOMxpath query() vs evaluate()

According to http://www.php.net/manual/en/class.domxpath.php , query() and evaluate() are both methods to DOMxpath and both do the same thing.

They both take the same parameters.

After searching high and low, I can’t figure out the difference. Also, why and when would you choose to use one method versus the other?

Where have you been searching (both high and low)? I advise you to re-read and compare the short sentences below the “Description” and “Return Values” sections of the appropriate manual pages[1][2]; then try the evaluate example but using the query method and see if you can understand the difference in results.

  1. http://php.net/domxpath.query
  2. http://php.net/domxpath.evaluate