Quote:
Originally Posted by Yoosha
1) OR V.S. ||
|
Personal preference, they are identical.
Quote:
Originally Posted by Yoosha
2) $_X V.S. $X
|
The _ just changes the variables name, there's nothing special about it.
It's like comparing $a to $b .
However, some superglobal variables (i.e. $_SESSION, $_GET, $_POST) have an underscore in them and I presume it is a safegaurd so that users don't accidentally overwrite / change variables.
Quote:
Originally Posted by Yoosha
3) @session_start(); V.S. session_start();
|
The @ suppresses any errors that the session_start() function might cause. Take a look at
PHP: Error Control Operators - Manual for more info.
Quote:
Originally Posted by Yoosha
4) if(!$X == Y) V.S. if($X != $Y)
|
I think Wildhoney's covered this pretty well, so I won't say too much.
I'm pretty sure that the first statement means - If the inverse of $X is equal to $Y , and the second one means if $X is not equal to $Y
Quote:
Originally Posted by Yoosha
5) if($X == $Y) V.S. if($X === $Y)
|
Read Wildhoney's post
Quote:
Originally Posted by Yoosha
6) if($X == '') V.S. if($X == null)
|
First checks if $X evaluates to an empty string. The second checks to see if $X evaluates to Null. Also read wildhoney's post
Quote:
Originally Posted by Yoosha
7) die(''); V.S. exit();
|
I'm pretty sure they are identical.