|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-03-30 15:41 UTC] felipe@php.net
[2008-03-30 15:47 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 18:00:02 2025 UTC |
Description: ------------ The code below has worked fine in all php 5 releases (that I've used for the past year and a half anyway). It now dies with 5.2.6. Reproduce code: --------------- class BaseLoginDA { protected $dbg; private static $instance; private function __construct(){ echo __METHOD__; } } class LoginDA extends BaseLoginDA { private static $instance; //implementing the singleton pattern static function getInstance(){ if (self::$instance){ return self::$instance; } else { self::$instance = new LoginDA(); return self::$instance; } } } $loginDA=LoginDA::getInstance(); Expected result: ---------------- an instantiated LoginDA object Actual result: -------------- Fatal error: Call to private BaseLoginDA::__construct() from context 'LoginDA'