Why isset() always returns FALSE on custom Object
<p>I cannot understand this behavior: My <code>isset()</code> check is always returning <strong>false</strong> on a <code>property</code> that has a value for sure!</p>

<pre><code>&lt;?php

  class User {
    protected $userId; // always filled
    protected $userName; // always filled

    /**
     * Magic method for the getters.
     * 
     * @param type $property
     * @return \self|property
     */
    public function __get($property) {
        if (property_exists($this, $property)) {
            return $this-&gt;$property;
        } else {
            throw new Exception('property '.$property.' does not exist in '.__CLASS__.' class');
        }
    }

  }

?&gt;
</code></pre>

<p>When I check this variable from another class with the following:</p>

<pre><code>isset($loggedUser-&gt;userName); // loggedUser is my instantiation of the User.php
</code></pre>

<p>It returns <code>FALSE</code>?? But when I overload the <code>__isset()</code> function in my User.php I get <code>TRUE</code> back as I expected:</p>

<pre><code>public function __isset($name)
{
    return isset($this-&gt;$name);
}
</code></pre>

<p>Just to be clear:</p>

<pre><code>echo $loggedUser-&gt;name;   // result "Adis"
isset($loggedUser-&gt;name); // results in FALSE, but why?
</code></pre>

<p>Thanks for your help!</p>
