|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-10-30 13:37 UTC] derick@php.net
[2002-10-30 14:07 UTC] enigma at turingstudio dot com
[2002-11-10 11:53 UTC] stas@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 09:00:02 2025 UTC |
ola, we've recently put in a set of methods in the binarycloud core classes so they can enforce their singleton status. An example: // {{{ method GetInstance() /** * This method enforces this class's singleton * status. It check s astatic var for an instance, * if that instance exists a reference to it * is returned. If it does not exist it is created * and a reference is returned. * @author hans lellelid, hans@velum.net * @access public */ function &GetInstance() { static $instance; if(!isset($instance)) { $instance = new Request(); } return $instance; } // }}} note the line: $instance = new Request(); that means the instance is always overwritten. we have to do that because: $instance =& new Request(); results in a null $instance. We believe this is a bug, but it's on the edge of possible expected behavior. thanks, _alex