Please add accessor methods to php sign now

Accessor methods in PHP

In C# there is a great feature called accessor methods.
It allows code to be executed when a variable is accessed, or assigned a value.
In php you might have done this:

private $Var;
public function getVar()
{
return $Var;
}
public function setVar($Val)
{
$this->Var = $Val;
}

With accessor methods the we could instead have done this:

private $var
public $Var
{
get
{
return $var;
}
set
{
$this->var = value;
}
}

And use it just like a normal variable.

The advantages of this approach is cleaner code that is easier to upkeep.


MSDN writes this about accessor methods
Properties are members that provide a flexible mechanism to read, write, or compute the values of private fields. Properties can be used as if they are public data members, but they are actually special methods called accessors. This enables data to be accessed easily and still helps promote the safety and flexibility of methods.


If you also want this feature in php6, please sign this petition.

Sign The Petition

Sign with Facebook
OR

If you already have an account please sign in, otherwise register an account for free then sign the petition filling the fields below.
Email and the password will be your account data, you will be able to sign other petitions after logging in.

Privacy in the search engines? You can use a nickname:

Attention, the email address you supply must be valid in order to validate the signature, otherwise it will be deleted.

I confirm registration and I agree to Usage and Limitations of Services

I confirm that I have read the Privacy Policy

I agree to the Personal Data Processing

Shoutbox

Who signed this petition saw these petitions too:

Sign The Petition

Sign with Facebook
OR

If you already have an account please sign in

Comment

I confirm registration and I agree to Usage and Limitations of Services

I confirm that I have read the Privacy Policy

I agree to the Personal Data Processing

Goal
0 / 50

Latest Signatures

No one has signed this petition yet

Information

Alyson BenjaminBy:
Politics and GovernmentIn:
Petition target:
The php dev. team

Tags

No tags

Share

Invite friends from your address book

Embed Codes

direct link

link for html

link for forum without title

link for forum with title

Widgets