The life of static methods in PHP
<p>I have a class in which I implement an array attribute. I want to set a couple of objects into that attribute. It will be done during the request flow many times, so it's declared as static. And it's not a singleton class.</p>

<p>Will the attribute in that class keep its earlier values when I'll add something to this the second time?
<em>(adding is done through a static method, if this changes anything)</em></p>

<p>The example:</p>

<pre><code>/* file1.php */
Foo::add('value1');
include 'file2.php';

/* file2.php */
...
Foo::add('value2');
</code></pre>

<p>This is the definition of <code>Foo</code>:</p>

<pre><code>class Foo {
   public static $bar = [];
   public static function add($value)
   {
      Foo::$bar[] = $value;
   }
}
</code></pre>

<p>Is this a good practice? Is singleton better here? Is there any other way to deal with this?</p>
