Req #22434 [Opn->Wfx]: Overload hides properties in class methods, too
| From: | stas@php.net | Date: | Sun, 26 Feb 2012 08:00:27 +0000 |
| Subject: | Req #22434 [Opn->Wfx]: Overload hides properties in class methods, too | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-167845@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=22434&edit=1
ID: 22434
Updated by: stas@php.net
Reported by: phpbugs at liwing dot de
Summary: Overload hides properties in class methods, too
-Status: Open
+Status: Wont fix
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: *General Issues
Operating System: FreeBSD 5.0-CURRENT
PHP Version: 4.3.1
Block user comment: N
Private report: N
New Comment:
We are sorry, but we can not support PHP 4 related problems anymore.
Momentum is gathering for PHP 6, and we think supporting PHP 4 will
lead to a waste of resources which we want to put into getting PHP 6
ready.
Previous Comments:
------------------------------------------------------------------------
[2003-02-26 07:57:52] phpbugs at liwing dot de
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!
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=22434&edit=1