What's different between "isset($string)" & "@$string" on PHP? -


what's different between isset($string) , @$string in php ?

this works both ways, what's difference?

if(isset($string))  ....   if(@$string)  .... 

function isset() check variable , return true if variable exists. sign @ ignore error. give same values. next code maybe show it:

   if(isset($string))       print 1; // no print    if(@$string)       print 2; // no print     $string = false;    if(isset($string))       print 3; // print 3    if(@$string)       print 4; // no print 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -