title: PHP - change class variable/function from outside the class
body: <p>Can I change a function or a variable defined in a class, from outside the class, but without using global variables?</p>
  
  <p>this is the class, inside include file #2:</p>
  
  <pre><code>class moo{
    function whatever(){
      $somestuff = "....";
      return $somestuff; // &lt;- is it possible to change this from "include file #1"
    }
  }
  </code></pre>
  
  <p>in the main application, this is how the class is used:</p>
  
  <pre><code>include "file1.php";
  include "file2.php"; // &lt;- this is where the class above is defined
  
  $what = $moo::whatever()
  ...
  </code></pre>