what is the '@' sign in php?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bertsmilsky
Forum Newbie
Posts: 13
Joined: Fri Jul 18, 2008 10:23 am

what is the '@' sign in php?

Post by bertsmilsky »

in the following php what does the '@' sign do:

1 )

Code: Select all

if(@$_SESSION['login'] !== true) {
 ...
}
2 )

Code: Select all

@ini_set('session.use_trans_sid', 0);
3 )

Code: Select all

@ob_start();
what is the difference if it was not in these examples?

thanks
User avatar
EverLearning
Forum Contributor
Posts: 282
Joined: Sat Feb 23, 2008 3:49 am
Location: Niš, Serbia

Re: what is the '@' sign in php?

Post by EverLearning »

bertsmilsky
Forum Newbie
Posts: 13
Joined: Fri Jul 18, 2008 10:23 am

Re: what is the '@' sign in php?

Post by bertsmilsky »

thanks, that makes sense

similarly, what does this '&' sign do?

Code: Select all

if (!isset($this->globalvariables))
{
 require_once(cms_join_path(dirname(__FILE__), 'class.globalvariables.inc.php'));
 $globalvariables =[color=#FF0000]&[/color] new GlobalVariables();
 $this->globalvariables = [color=#FF0000]&[/color]$globalvariables;
}
haritha
Forum Newbie
Posts: 2
Joined: Wed Aug 13, 2008 4:52 am

Re: what is the '@' sign in php?

Post by haritha »

bertsmilsky wrote:in the following php what does the '@' sign do:

1 )

Code: Select all

if(@$_SESSION['login'] !== true) {
 ...
}
2 )

Code: Select all

@ini_set('session.use_trans_sid', 0);
3 )

Code: Select all

@ob_start();
what is the difference if it was not in these examples?

thanks
User avatar
EverLearning
Forum Contributor
Posts: 282
Joined: Sat Feb 23, 2008 3:49 am
Location: Niš, Serbia

Re: what is the '@' sign in php?

Post by EverLearning »

Post Reply