title: How to check if a SimpleHTMLDom element does not exist
body: <p>SimpleHtmldom can be used to extract the contents of the first element with class <code>description</code>. </p>
  
  <pre><code>$html = str_get_html($html);
  $html-&gt;find('.description', 0)
  </code></pre>
  
  <p>However if this class does not exist, PHP will throw an error </p>
  
  <p><code>Trying to get property of non-object</code></p>
  
  <p>I tried</p>
  
  <pre><code>if(!isset($html-&gt;find('.description', 0))) {
      echo 'not set';
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>if(!empty($html-&gt;find('.description', 0))) {
      echo 'not set';
  }
  </code></pre>
  
  <p>but both gives the error</p>
  
  <pre><code>Can't use method return value in write context
  </code></pre>
  
  <p><strong>What is the proper way to check if the element exist?</strong></p>