Class instance variables becoming null in php
<p>I have this PHP class, whose purpose is to fetch some configuration data from a database and store it for later use:</p>

<pre><code>class GSConfig {
  private $configurationData;
  private $repository;

  public function __construct($pRepository) {
    $this-&gt;repository = $pRepository;
    $this-&gt;configurationData = $this-&gt;InitializeConfiguration();
  }

  public function InitializeConfiguration() {
    $result = $this-&gt;repository-&gt;configLoadAll();
    if ( $result['data'] ) {
      $conf_array = $result['data'];
      foreach ( $conf_array as $row) {
        $code = strtolower($row ['code']);
        $value = strtolower($row ['value']);
        //if ($value == "true") $value = (bool)true;
        //if ($value == "false") $value = (bool)false;
        $this-&gt;configurationData[$code] = $value;
      }
    } else {
      $this-&gt;configurationData = null;
    }
    print_r($this-&gt;configurationData);
  }

  public function getConfigValue($key) {
    $key = strtolower($key);
    if ($this-&gt;configurationData != null) {
      if( isset($this-&gt;configurationData[$key])) {
        return $this-&gt;configurationData[$key];
      }
    } else if ($this-&gt;configurationData == null) {
      // If we reach this code, something went wrong
      // (TODO: throw Exception)
      echo "&lt;p&gt;Tick&lt;/p&gt;";
    }
  }
}
</code></pre>

<p>InitializeConfiguration gets the data and stores it as an array in the $configurationData property. This is working as expected as shown by the output of the print_r function.
However, after initializing, if i attempt to read any value from the $configurationData, i get <code>Tick</code>. Somehow the variable becomes null after the Initialization.</p>

<p>The output would be something like:</p>

<pre><code>print_r output:
Array ( [show_cart] =&gt; true [order_mail] =&gt; order@shop.de [debug_mode] =&gt; true [branch_mode] =&gt; true [default_branch] =&gt; 1 [agb_file] =&gt; agb.txt [kat_order] =&gt; k_nr [show_rows] =&gt; 5 [product_order] =&gt; p_produktnr [cost_per_wu] =&gt; 0.66 [message_lang] =&gt; eng [free_shipping] =&gt; true [free_ship_amt] =&gt; 25 [special_price] =&gt; true [discounts] =&gt; true [cat_show_mode] =&gt; all [price_att] =&gt; ersatzpreis [mwst_att] =&gt; mehrwertsteuer [aktionsp_att] =&gt; aktionspreis [katalog_mode] =&gt; per_branch )
further output: 
Tick
Tick
...
Tick
</code></pre>

<p>Anyone knows why this is happenning? Btw, my PHP version is 5.3.1</p>
