So I have this strange situation where I assign a classvariable a
value, but when I read the value it is NULL.

The class has one variable declared:
class A {
        private $_cookies;

In a method of this class I assign this classvariable plus an
undeclared classvariable and a local variable the value 1:
$this->_cookies = 1;
$this->_cookies2 = 1;
$cookies3 = 1;

When I now read the values of those variables, the classvariables are
NULL while the local variable is 1:
$logEntry .= 'cookies: ' . var_export($this->_cookies, true) . PHP_EOL;
$logEntry .= 'cookies2: ' . var_export($this->_cookies2, true) . PHP_EOL;
$logEntry .= 'cookies3: ' . var_export($cookies3, true) . PHP_EOL;
cookies: NULL
cookies2: NULL
cookies3: 1

But when reading the whole object, the classvariables are 1:
$logEntry .= var_export($this, true) . PHP_EOL;
   '_cookies' => 1,
   '_cookies2' => 1,

This happens periodically on a busy webserver. It seems that when it
happens, all classvariables cannot be read anymore (return NULL).
After restarting Apache it does not happen anymore, just to happen
again after some minutes.

The system is current Debian Squeeze:
Linux: linux-image-2.6.32-5-amd64
Apache: apache2-mpm-prefork 2.2.16-6+squeeze7
PHP: PHP 5.3.3-7+squeeze13 with Suhosin-Patch (cli) (built: Jun 10
2012 07:31:32)
php -m: 
php -i: 

Does anyone have an idea what could cause this, or how to further debug?


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to