title: PHP:isset() returns false for object's dynamic properties
body: <p>I have a heirarchy of classes that get initialized from a database. I am using __get() and __set() with an array in a common Item base class to support different numbers of properties. One class derived from Item, UserProfile is used to store user data. There is a phone number table in my database with a one-to-many relationship to the user table to store multiple phone numbers for one user. If there is a mobile phone, then the UserProfile object has a mobile field. Same for home and business. If no number exists, no property exists.</p>
  
  <p>The problem comes when I want to test for the existence of these properties. when I use code like</p>
  
  <pre><code>if (isset($clientData-&gt;home_phone))
  {
  $this-&gt;startElement('phone');
  $this-&gt;writeAttribute('phone_number_type','home');
  $this-&gt;writeRaw($clientData-&gt;home_phone);
  $this-&gt;endElement();
  }
  </code></pre>
  
  <p>The function always returns false. I tried using brackets to tell php to get the variable first, but I just got errors. Do I need a special attributeExists() function to simulate isset()'s functionality, or is there a more straightforward approach?</p>
  
  <p>How can I test for the existence of a dynamic property without some kind of error?</p>