title: Simple HTML DOM Parser crashes
body: <p>When you load a large HTML page into simple_html_dom it crashes. when I parse <a href="http://www.cityvibe.com/lasvegas/Escorts/" rel="nofollow noreferrer">Washington</a> url it works but when I parse <a href="http://www.cityvibe.com/lasvegas/Escorts/" rel="nofollow noreferrer">las vegas</a> it's doesn't work and It shows this error. </p>
  
  <p><code>
  PHP Fatal error:  Call to a member function find() on a non-object in /var/www/html/city2.php on line 20
  </code></p>
  
  <p>Here is the code </p>
  
  <pre><code>&lt;?php
  
  function httpGet($url)
  {
      $ch = curl_init();  
  
      curl_setopt($ch,CURLOPT_URL,$url);
      curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
  //  curl_setopt($ch,CURLOPT_HEADER, false); 
  
      $output=curl_exec($ch);
  
      curl_close($ch);
      return $output;
  }
  include_once('simple_html_dom.php');
  $url="http://www.cityvibe.com/lasvegas/Escorts/";
  $parse=httpGet($url);
  $html = str_get_html($parse);
  for ($y = 0; $y &lt;= 10; $y++) {
  $ret = $html-&gt;find('.image-link',$y)-&gt;href;
  $rep=str_replace("//","http://",$ret);
  $esc=httpGet($rep);
  $grep=str_get_html($esc);
  $ret2 = $grep-&gt;find('.post-name',0)-&gt;innertext;
  echo $ret2;
  ?&gt;
  </code></pre>
  
  <p>I have tried to fix the memory leak but it's still not working </p>
  
  <p><a href="https://stackoverflow.com/questions/18090212/php-simple-html-dom-parser-memory-leak-usage">PHP Simple HTML Dom Parser Memory Leak / Usage</a></p>
  
  <p>any way to fix this?</p>