Ilia Alshanetsky wrote:

Do we really need this function? I see 2 ways of 'implementing' this functionality in PHP without having to add another function. For example:
(isset($var) || is_null($var)) or gettype($var).


Ilia


I for one would like to see something like variable_exists(), as I am very annoyed with
the logic of isset() returning false if the variable exists and has a value of null.


The name of the function in this case doesn't not fit the logic for isset(). The variable does exist and it IS in fact set, the value just so happens to be null.
I constantly get puzzled looks and confusion, when I explain to folks that are new to php, that isset() really doesn't do what it's name suggests.


 I for one would much rather do
 if ( variable_exists($var) ) {}  versus
if (isset($var) || is_null($var)) {}

it's less code to type and is less prone to errors.

So I would like to see the patch in, or something similar in functionality, since isset() doesn't do what I'd expect.
Walt




--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to