Programmer's Wiki

A variable is said to be undefined (or some variant thereof) in various situations according to the language context.

In the lower languages (e.g. C, C++), an uninitialized variable holds an arbitrary value which must be replaced before use to avoid undefined behavior (typically a segmentation fault).

JavaScript provides the undefined literal, which implies as a variable's value that the program simply has not used the variable yet, whereas null means the program has explicitly deemed the value unknown. However, undefined can be assigned to a variable or returned from a function just as easily as null.

In PHP, undefined is replaced with the isset and unset language constructs. I.e., "unset" is only the state of a variable rather than its value and will not be transferred by assignment except by reference. (An assignment by value would actually set the left variable to null.) Handling an unset variable as if it were set will cause an E_NOTICE error[1] (similar to the segmentation fault above).