title: Spurious PHP undeclared static property
body: <p>Running Debian Squeeze servers with PHP 5.3.x (happens with both Apache and nginx) I'm seeing random occurrences of the fatal error undeclared static property.  Often this refers to the following code:</p>
  
  <pre><code>class aliro extends aliroBase {
          private static $instance = null;
  
          public static function getInstance () {
              return self::$instance instanceof self ? self::$instance : (self::$instance = new self());
          }
  ...
  </code></pre>
  
  <p>and states that <code>aliro::$instance</code> is undeclared on the last line shown above (not counting the close curly bracket).  Yet the variable is quite plainly declared just a couple of lines earlier. (The exact error message is "PHP Fatal error:  Access to undeclared static property: aliro::$instance in /var/www/apic/public_html/aliro.php on line 91").</p>
  
  <p>This code is executed for every request to the server, which is currently running about 1,250 requests per hour.  But the error appears to occur once an hour.</p>
  
  <p>Simultaneously, syslog may show a suhosin error message:</p>
  
  <pre><code>Oct 22 11:29:45 apic suhosin[20764]: ALERT-SIMULATION - 
  canary mismatch on efree() - heap overflow detected at 0x2ec9118
  </code></pre>
  
  <p>or a kernel error, such as:</p>
  
  <pre><code>Oct 22 10:29:43 apic kernel: [83469.382141] php[9479] general protection 
  ip:6a8161 sp:7fffa270ec20 error:0 in php5[400000+6f9000]
  </code></pre>
  
  <p>or</p>
  
  <pre><code>Oct 22 09:29:45 apic kernel: [79871.245018] php[705]: segfault at 27f2298 
  ip 00007f24229e640e sp 00007fff13aca388 error 6 in 
  libc-2.11.2.so[7f2422968000+158000]
  </code></pre>
  
  <p>Cron is running every five minutes to trigger munin-node, but the errors only occur once an hour. What could be causing this?  </p>
  
  <p>Being non-repeatable, it isn't clear what can be done, although the errors are creating a risk of data corruption.  Any suggestions?</p>