title: Simplexml xpath formula not working
body: <p>I can not make work the formula in xpath. Here is a part of code to <strong>reproduce the issue</strong>:</p>
  
  <pre><code>//$val['path_xml'] = "price + 1"
  $valID = $result[$i]-&gt;xpath($val['path_xml']);
  echo "&lt;br&gt;".$val['path_xml']."&lt;br&gt;";
  echo $result[$i]-&gt;price."&lt;br&gt;";
  echo json_encode($valID)."&lt;br&gt;";
  </code></pre>
  
  <p>The output of the code is:</p>
  
  <pre><code>price + 1   // as expected - the correct path
  525000      // just for test to check if price exists
  []          // empty array????
  </code></pre>
  
  <p><strong>Test 2</strong> - just to make sure everything works fine:</p>
  
  <pre><code>//$val['path_xml'] = "price"
  $valID = $result[$i]-&gt;xpath($val['path_xml']);
  echo "&lt;br&gt;".$val['path_xml']."&lt;br&gt;";
  echo $result[$i]-&gt;price."&lt;br&gt;";
  echo json_encode($valID)."&lt;br&gt;";
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>price             // correct
  525000            // ok
  [{"0":"525000"}]  // OK
  </code></pre>
  
  <p>Can someone give any idea why the formulas are not working? Maybe need a newer version of PHP (currently 5.6) or any other ideas?</p>
  
  <p>Checked it with this online tool and it works perfectly: <a href="http://www.freeformatter.com/xpath-tester.html#ad-output" rel="nofollow">http://www.freeformatter.com/xpath-tester.html#ad-output</a> </p>