Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • It's mean - in the code above I check is variable set or not twice?:) Commented Aug 25, 2011 at 13:58
  • Just check whether it is empty, php won't throw an error if this is not the case. Commented Aug 25, 2011 at 13:59
  • 3
    You are omitting the biggest point of empty: It doesn't throw a warning when the tested variable does not exist. That's the whole point of this function, otherwise it's identical to == false. Commented Aug 25, 2011 at 14:02
  • 1
    So, the fact in manual that "no warning is generated when the variable is not set" confused me. No warning doesn't mean that I will not have troubles in the code below. Now it's clear for me. Thx alot! Commented Aug 25, 2011 at 14:09
  • "isset just checks if is it set, it could still be null" That's not true: isset on a null (and existing) variable will evaluate to false. Commented Aug 25, 2011 at 14:30