title: Method from another class called from inside a class
body: <p>I dont know if its possible in PHP. I tried this code but I got error.</p>
  
  <pre><code>class UserAccount extends classDatabase
  {
      $validate = new classValidate;
      function login($user, $pass)
      {
         //access a method from classValidate
         $validate-&gt;checkInput($user);
      }
  }
  </code></pre>
  
  <p>I want to validate user input by using a method from <code>classValidate</code>. How to do that? I can't extend <code>classValidate</code> because I already extend <code>classDatabase</code>.</p>
  
  <p>Please tell me a way how to do this.</p>