title: Function saying i cannot redeclare php
body: <p>I am working with an API that has a function called invokeGetMatchingProductForId() and every time the script is run, this error occurs. I am attempting to loop through the script to change one variable but i am not sure if that is the problem. If you guys have any suggestions let me know. Any help would be much appreciated! Thanks in advance!</p>
  
  <pre><code>  function invokeGetMatchingProductForId(MarketplaceWebServiceProducts_Interface $service, $request)
    {
    try {
      $response = $service-&gt;GetMatchingProductForId($request);
  
      echo ("Service Response\n");
      echo ("=============================================================================\n");
        global $file_name;
        global $i;
      $dom = new DOMDocument();
      $dom-&gt;loadXML($response-&gt;toXML());
      $dom-&gt;preserveWhiteSpace = false;
      $dom-&gt;formatOutput = true;
      echo $dom-&gt;saveXML();
      $dom -&gt;save('xml/' . $file_name . $i . '.xml');  
      echo("ResponseHeaderMetadata: " . $response-&gt;getResponseHeaderMetadata() . "\n");
  
   } catch (MarketplaceWebServiceProducts_Exception $ex) {
      echo("Caught Exception: " . $ex-&gt;getMessage() . "\n");
      echo("Response Status Code: " . $ex-&gt;getStatusCode() . "\n");
      echo("Error Code: " . $ex-&gt;getErrorCode() . "\n");
      echo("Error Type: " . $ex-&gt;getErrorType() . "\n");
      echo("Request ID: " . $ex-&gt;getRequestId() . "\n");
      echo("XML: " . $ex-&gt;getXML() . "\n");
      echo("ResponseHeaderMetadata: " . $ex-    &gt;getResponseHeaderMetadata() . "\n");
   }
   }
  </code></pre>
  
  <p>When I get a response from the server, This error occurs. </p>
  
  <pre><code>Fatal error: Cannot redeclare function()(previously declared in x:\xampp\htdocs\name\src\project0\php\unknown.php:110) in x:\xampp\htdocs\name\src\project0\php\unknown.php on line 136
  </code></pre>
  
  <p>Line 136 is an empty line. </p>