|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-04-07 18:14 UTC] sniper@php.net
[2005-04-07 18:29 UTC] jon dot brightwell at s2o dot co dot uk
[2005-04-07 21:55 UTC] phpbugs at majiclab dot com
[2005-04-07 22:25 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 02:00:01 2025 UTC |
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