title: Google Maps API exceeds memory limit when hash symbol present in address string
body: <p>I'm using the GoogleMaps API to get the lat and long for an address, but strangely enough Google Maps causes PHP to run out of memory when a <code>#</code> symbol is present in the string...</p>
  
  <p>The code: </p>
  
  <pre><code>//some attempted addresses: "1234 Memory Lane Suite #1", "4321 Test Dr #4", "#" 
  $this-&gt;address = htmlentities($_POST['address']);
      $googlemaps = new GoogleMaps(GOOGLE_MAPS_API_KEY);
      $coordinates = $googlemaps-&gt;getCoordinates(
          'UNITED STATES, ' . 
          $this-&gt;state . ', ' . 
          $this-&gt;city . ', ' .
          $this-&gt;address
      );
  </code></pre>
  
  <p>The error: </p>
  
  <pre><code>Allowed memory size of 268435456 bytes exhausted (tried to allocate 19574456 bytes)
  </code></pre>
  
  <p>When I strip out the pound symbol, everything works correctly. Just kind of curious what is Google's problem with the hash symbol?</p>
  
  <p>Here's the source code of the API, It's pretty short: </p>
  
  <pre><code>class GoogleMaps {
  
      /**
      * The Google Maps API key holder
      * @var string 
      */
      private $mapApiKey;
  
      /**
      * Class Constructor
      */
      public function __construct() {
      }
  
      /**
      * Reads an URL to a string
      * @param string $url The URL to read from
      * @return string The URL content
      */
      private function getURL($url){
          $ch = curl_init();
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
          curl_setopt($ch, CURLOPT_HEADER, 0);
          curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
          curl_setopt($ch, CURLOPT_URL, $url);
          $tmp = curl_exec($ch);
          curl_close($ch);
          if ($tmp != false){
              return $tmp;
          }
      }
  
      /**
      * Get Latitude/Longitude/Altitude based on an address
      * @param string $address The address for converting into coordinates
      * @return array An array containing Latitude/Longitude/Altitude data
      */
      public function getCoordinates($address){
          $address = str_replace(' ','+',$address);
          $url = 'http://maps.google.com/maps/geo?q=' . $address . '&amp;output=xml';
          $data = $this-&gt;getURL($url);
          if ($data){
              $xml = new SimpleXMLElement($data);
              $requestCode = $xml-&gt;Response-&gt;Status-&gt;code;
              if ($requestCode == 200){
                  //all is ok
                  $coords = $xml-&gt;Response-&gt;Placemark-&gt;Point-&gt;coordinates;
                  $coords = explode(',',$coords);
                  if (count($coords) &gt; 1){
                      if (count($coords) == 3){
                          return array('lat' =&gt; $coords[1], 'long' =&gt; $coords[0], 'alt' =&gt; $coords[2]);
                      } else {
                          return array('lat' =&gt; $coords[1], 'long' =&gt; $coords[0], 'alt' =&gt; 0);
                      }
                  }
              }
          }
          //return default data
          return array('lat' =&gt; 0, 'long' =&gt; 0, 'alt' =&gt; 0);
      }
  
  
  }; //end class`
  </code></pre>