php static variable is not getting set
<p>I have a situation where i need to maintain a static variable globally where it value can be change by diferent php files.</p>

<p>I have below class,</p>

<pre><code>&lt;?php
class FlagMe {
    public static $flag;

    public static function setFlag($flag) {
        self::$flag = $flag;
    }

    public static function getFlag() {

        return self::$flag;
    }
}
?&gt;
</code></pre>

<p>And I am setting a value from a diferent php file like below,</p>

<pre><code>FlagMe::setFlag("SomeValue");
</code></pre>

<p>But suppose after a post request code flow in same php script (controller class) with a page refresh, and when I am try to access that static variable it gives me instead of giveing the set value "SomeValue" previously.</p>

<pre><code>$temVar = FlagMe::getFlag(); // gives null
</code></pre>

<p>What am I missing here please?</p>

<p>Thanks.</p>
