According to the SimpleHtmlDOM Api str_get_html($html) expects a string as input. First check with a html validator if your code is well formatted.
$htmlObj = str_get_html($html);
if (!is_object($htmlObj)) return; // catch errors
// or wrap further code in
if (is_object($htmlObj)) { /* doWork */ }