Thread: Differents...
View Single Post
Old 06-22-2008, 04:46 PM   #3 (permalink)
Alex
The Wanderer
 
Join Date: May 2008
Posts: 17
Thanks: 2
Alex is on a distinguished road
Default

Quote:
Originally Posted by Yoosha View Post
1) OR V.S. ||
Personal preference, they are identical.
Quote:
Originally Posted by Yoosha View Post
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 View Post
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 View Post
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 View Post
5) if($X == $Y) V.S. if($X === $Y)
Read Wildhoney's post
Quote:
Originally Posted by Yoosha View Post
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 View Post
7) die(''); V.S. exit();
I'm pretty sure they are identical.
Alex is offline  
Reply With Quote
The Following User Says Thank You to Alex For This Useful Post:
Yoosha (06-23-2008)