php class member array being inappropriately cached
<p>Let's say I have the following:</p>

<pre><code>&lt;?php
class MyClass {
  public $validThings = array("Stuff");

  //checks to see if $input is in the array $validThings
  public function valid($input) {
    return is_int(array_search($input, $this-&gt;validThings);
  }
}
</code></pre>

<p>We would expect the following:</p>

<pre><code>$myClassInstance-&gt;valid("Stuff");//finds 'Stuff'
$myClassInstance-&gt;valid("Things");//doesn't find 'Things'
</code></pre>

<p>Now lets say that I change the code for the initialization of $validThings to:</p>

<pre><code>public $validThings = array("Stuff", "Things");
</code></pre>

<p>We would expect:</p>

<pre><code>$myClassInstance-&gt;valid("Stuff");//finds 'Stuff'
$myClassInstance-&gt;valid("Things");//finds 'Things'
</code></pre>

<p>The behavior I'm seeing, though, is that the second call still won't find 'Things'. I suspect this has something to do with how PHP is cached, but I don't know what specifically. It is highly reproducible: I can change the array any which way in code, and so long as I don't modify that member variable within a function call it will hold onto the original value... <em>even across apache hard restarts</em>.</p>

<p>Has anyone seen this who can explain the behavior?</p>

<p>To clarify a point: there is some form of caching behavior going on here that has to do with some implementation detail of php or caching around php. This is not a code bug; it is merely a behavior revealed by this code. Also, we're using <a href="http://pecl.php.net/package/hidef" rel="nofollow">hidef</a>, which may be a salient detail and php 5.2.10</p>
