title: Access function in class A from non related class B using object of class A
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7100757/call-function-of-class-one-from-class-two-without-extend">Call function of class ONE from class TWO without extend?</a>  </p>
  </blockquote>
  
  
  
  <p>why this does not work?</p>
  
  <pre><code>    class A {
          function one() {
              echo "Class A";
          }
      }
  
      class B {
          function two() {
              echo "Class B";
              $a-&gt;one();
          }
      }
  
  
      $a = new A; 
      $b = new B;
  
      $b-&gt;two();
  </code></pre>