title: php - class property issues
body: <p>I am trying to get the class's property in PHP</p>
  
  <pre><code>class Test(){
      public function import($data) {
          $im = new import($this, $data);
          $im-&gt;getInfo();
  
          $this-&gt;fileInfo = $im-&gt;getRecord();
          new ImportData($this, $this-&gt;fileInfo);
          return true;
      }
  
      public function getFilePath(){
          return $this-&gt;fileInfo;
      }
  }
  </code></pre>
  
  <p>In my other file.</p>
  
  <pre><code>$import = new Test();
  
  $filePath = $import -&gt;getFilePath();
  
  //$filePath returns nothing becasue $this-&gt;fileInfo is not init yet.  
  
  
  //my other codes here.
  //my other codes here.
  
  //call import method here.
  $import -&gt;import($data);
  </code></pre>
  
  <p>I need to call <code>getFilePath</code> before <code>import</code> method but I can only get the <code>$this-&gt;fileInfo</code> in <code>import</code> method. 
  Are there anyways around this? Thanks so much!</p>