SET = מוגדר, קבוע.ISSET (IS SET) - האם מוגדר, בודקת האם משתנה מוגדר ומחזירה TRUE או FALSE.
UNSET - מסירה "הגדרה" של משתנה, כך שאם הוא היה מוגדר כעת הוא יימחק.
NULL נותן בעצם ערך של "כלום".
A small but important difference between "is_null" and "isset" is the following: "is_null" tests if an *expression* (not a *variable*) is null, while "isset" tests if a *variable* has null value or is undefined. The difference is manifested in the two following experiments: Experiment 1: <?php function test() { return null; } var_dump(is_null(test())); // displays "true" var_dump(isset(test())); // parse error, because "test()" is not a variable ?> Experiment 2: <?php error_reporting(E_ALL); var_dump(isset($an_undefined_variable)); // displays "false" since "$an_undefined_variable" is not defined var_dump(is_null($an_undefined_variable)); // displays "true" (as expected), but throws a notice because "$an_undefined_variable" is not defined. ?>
|
