<?php

if ( $main_content ) {
	$page->find( '.main' )[0]->innertext = $main_content;
}

?>

<?php

if ( $main_content ) {
	$mains = $page->find( '.main' );
	if ( count( $mains ) > 0 ) {
		$mains[ 0 ]->innertext = $main_content;
	}
}

?>

Remove PHP error on PHP5.2
Remove PHP error on PHP5.2
