So, you may pass any value to it,.
Knowing that, allows us to draw the following unlikely conclusion: isset as a language construct is way faster, more reliable and powerful than is_null and should be prefered over is_null except for when you're directly passing a function's result, which is considered bad programming practice.
this will print out something like: 10 / null 01 / true 01 / false 01 / 0 01 / 1 01 / ' 01 / "0 notice: Undefined variable: var in /srv/www/htdocs/sandbox/null/p on line 8 10 .
true 'I am not one piece film z 2013 greek subs false!Isset on the other hand is supposed to check for a variable's existence, which makes it a language construct rather than a function.For what I realized is that is_null(var) returns exactly the opposite of isset(var), except that is_null(var) throws a notice if var hasn't been set yet.If a null constant is redefined in a namespace other than global, you will get unexpected results when comparing to null inside the namespace.The following will prove that:?php quirks array(null, true, false, 0, 1, "0 "unset foreach(quirks as var) if (var "unset unset(var echo is_null(var)?Otherwise it may lead to application failures and potential security issues where certain checks could be effectively disabled.define false 'I am not global false!A simple example to demonstrate the behavior:?php namespace RedefinedConstants / redefining global namespace constants has no effect define null 'I am not global null!1 : 0; echo isset(var)?
Be careful using null together with namespaces.
Its sole porpuse lies in that checking.
You might want to examine the return value of those functions in detail, but since both are specified to return boolean types there should be no doubt.1 : 0; echo "n?The result of a function.redefining local namespace constants will work 'I am not null!define true 'I am not global true!Instead always use null, false, and true when comparing.