Date: 06/27/01
- Next message: vlast <email protected>: "[PHP-DEV] Bug #11758: --with-apxs2 compile option failed with Apache 2.0.16"
- Previous message: edwin <email protected>: "[PHP-DEV] Bug #11757: Additional Comment to #11688 ImageTTFText ImageTTFBBox"
- Next in thread: derick <email protected>: "[PHP-DEV] Bug #11756 Updated: Private, Protected variables in classes"
- Maybe reply: derick <email protected>: "[PHP-DEV] Bug #11756 Updated: Private, Protected variables in classes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
ID: 11756
User Update by: alavoor <email protected>
Status: Open
Bug Type: Feature/Change Request
Operating system: Linux
PHP Version: 4.0.6
Description: Private, Protected variables in classes
for example:
class
{
private:
var $myvar;
var $myvar2:
public:
var $myvar3;
function myfoo()
{
print "the variable is : " . $myvar
}
}
will be converted "on the fly" by PHP interpreter to
class
{
var $myvar_993679346;
var $myvar2_993679346:
var $myvar3;
function myfoo()
{
print "the variable is : " . $myvar_993679346;
}
}
Note that 993679346 is the time stamp got by time(). PHP interpreter when it starts up will store this
timestamp value in a global var and use it throught to mangle all the private variables declared in
all the classes in all the files..
Previous Comments:
---------------------------------------------------------------------------
[2001-06-27 17:47:52] alavoor <email protected>
I have a good idea. It is extremely easy to implement private, protected variables in classes.
PHP can use the name mangling of variables to implement private variables in classes. This technique is used by python language.
What you do is - PHP will read the class and simply change the variable names to <variablename>_timestamp. Where timestamp is unique id got by time() function.
Classes need private, protected variables. What do you say??
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=11756
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: vlast <email protected>: "[PHP-DEV] Bug #11758: --with-apxs2 compile option failed with Apache 2.0.16"
- Previous message: edwin <email protected>: "[PHP-DEV] Bug #11757: Additional Comment to #11688 ImageTTFText ImageTTFBBox"
- Next in thread: derick <email protected>: "[PHP-DEV] Bug #11756 Updated: Private, Protected variables in classes"
- Maybe reply: derick <email protected>: "[PHP-DEV] Bug #11756 Updated: Private, Protected variables in classes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

