|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-02-26 08:00 UTC] stas@php.net
[2012-02-26 08:00 UTC] stas@php.net
-Status: Open
+Status: Wont fix
-Package: Feature/Change Request
+Package: *General Issues
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 10:00:01 2025 UTC |
More complex classes which's properties should become protected may need to modify / initializes some of their management properties in constructor or in an important member method. Imagine a central factory manager using a list of meta objects . Or a public/private key manager class, which has to manager 3 lists, public keys, private keys and passphrases. If the list aren't hard-coded in each class but list objects as members are used, a constructor like class CertMgr { var $PublicKeys; var $PrivateKeys; function CertMgr() { $this->PublicKeys = & new List(); $this->PrivateKeys = & new List(); $this->PublicKeys->SetValue( "mine", "abcdefg" ); $this->PrivateKeys->SetValue( "mine", "secret-of-abcdefg" ); } function __get( $pn, &$pv ) { if( $this->PublicKeys->KeyExists( $pn ) ) { $pv = $this->PublicKeys->GetValue( $pn ); return TRUE; } else { return FALSE; } } } // end of class CertMgr overload( "CertMgr" ); $myCertMgr = new CertMgr(); // will fail!