Empty,isset First checks whether a variable exists , and then detects the value of the variable. and is_null Just checks the value of the variable directly, whether it is null, so if the variable is undefined, an error will occur!
later:
Detects if a variable is null with:is_null, but if the variable is undefined, it is detected with an error. Judge Null with Is_null (), if the variable is undefined, the error
Detecting whether a variable is defined can be used: isset, but it returns false if the value of a variable is: null. Determines whether the variable is defined, with Isset, and returns False if the value of the variable is null
The difference between empty and isset
1, treats $c = null, the processing on isset returns False,empty true
Unset is a direct delete variable
$a= "Hello"; $b $a ; // echo $b. ' SSS '. $a;//echo Hello unset ($b); Echo $b; // unset is to remove the variable definition, so the output will error
Variables to assign values to each other:
//variable assignment of values to each other$a= "Hello";$b=$a;Echo $b.‘ SSS '.$a;//echo Hello$a= "World";Echo $b.$a;//Output Hello World description variables are assigned to each other to copy a copyunset($b);Echo $b;//unset is to remove the variable definition, so the output will error//object Mutual Assignmentclassa{ Public $num=100; }$a=NewA ();$b=$a;//point to the same object$a->num=200;Echo $b->num;//Output
Summary: variables are assigned to each other and are copies of copies. If the variable is an object, assigning values to each other is to point to the same object
RELATED links:
Http://www.cnblogs.com/chengmo/archive/2010/10/18/1854258.html
PHP's Is_null+empty+isset+unset