title: Notice: Use of undefined constant self - assumed 'self' , When put in property_exists as the first argument
body: <p>I'm trying to use <code>self</code> instead of typing the class name inside <code>propery_exists</code> function as follows :</p>
  
  <pre><code>private static function instantiate($record){
      $user = new self;
      foreach($record as $name =&gt; $value){
          if(isset($user-&gt;$name) || property_exists(self, $name)){
              $user-&gt;$name = $value;
          }
      }
      return $user;
  }
  </code></pre>
  
  <p>But when i ran this script it get an error :</p>
  
  <blockquote>
    <p>Notice: Use of undefined constant self - assumed 'self' in
    /var/www/photo_gallery/includes/User.php on line 36</p>
  </blockquote>
  
  <p>Line 36 is the line where <code>property_exists</code> method is called.</p>
  
  <p>When i change self to <code>User</code> (the class name). It works perfectly. </p>
  
  <p>I want to know why using <code>self</code> is giving such a notice ? Doesn't <code>self</code> refer to the class? </p>