php中的$ variable和@ $变量之间的区别[重复]

This question already has an answer here:

Can you please tell me the difference between $variable and @$variable in php

<?php
 curl function abc
{
 get information of url and return information string
}
$html=abc();
$doc=DOMDocument();
@$doc->LoadHTML($html); 
?>

here if we take normal variable it gives error why its so and whats the difference

</div>

A @ before a function call means "suppress warnings".

So, @$doc->LoadHTML($html); suppresses warnings from the method call (LoadHTML()).

In general this is a bad idea, because the warnings mean you are doing something wrong, and you would better fix that instead of playing deaf.

The @ operator tells the compiler to ignore the error that PHP could give, its advised not to use it.

Suppress warning when accessing that property, if for instance $html was undefined then no error is displayed, see http://davidwalsh.name/suppress-php-errors-warnings

@ is called Error Control Operator, it can be prepended before expression to disable error reporting for that expression.

Please see this post for more information: Suppress error with @ operator in PHP