From: jon dot brightwell at s2o dot co dot uk
Operating system: W2k srv IIS
PHP version: 5.0.3
PHP Bug Type: Class/Object related
Bug description: dynamic object reference is not stored in a static var
Description:
------------
$mcp is a class instance.
constructor of mcp stores a reference of itself in a seperate static
class.
Reproduce code:
---------------
$yo = new mcp();
class mcp
{
public function __construct()
{
io_tower::setMCP($this);
}
}
class io_tower
{
static public function getMCP()
{
return self::$mcp;
}
static public function setMCP($import)
{
try
{
if(is_object(self::$mcp)) throw new Exception("MCP
already exists");
}catch (Exception $e){return;}
self::$mcp= $import;
}
}
Expected result:
----------------
io_tower(self)::$mcp = instance of mcp
ie. io_tower::getMCP() = instance
Actual result:
--------------
io_tower(self)::$mcp = null
ie. io_tower::getMCP() = null
--
Edit bug report at http://bugs.php.net/?id=32626&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32626&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=32626&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=32626&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32626&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32626&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32626&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32626&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32626&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32626&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32626&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=32626&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=32626&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32626&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32626&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32626&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32626&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32626&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32626&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32626&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32626&r=mysqlcfg