|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #69262 Native property-support
Submitted: 2015-03-19 11:13 UTC Modified: 2015-03-20 14:49 UTC
From: andreas dot prucha at gmail dot com Assigned:
Status: Duplicate Package: PHP Language Specification
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: andreas dot prucha at gmail dot com
New email:
PHP Version: OS:


 [2015-03-19 11:13 UTC] andreas dot prucha at gmail dot com
I think native support for properties like in Delphi would be nice. For example:


  protected $myPropertyField;

  public proprety $myProperty get $myPropertyField set setMyProperty;

  public function setMyProperty($aValue)
    $this->myPropertyField = $aValue;


In the declaration a getter and setter could be defined, which could be either direct reference to a variable or a setter/getter function.

I know it's syntatctic sugar, but it may make property declarations more obvious, easier to document (once phpdocumentor supports it) and it might even bring slight performance gains as we do not go through __get and __set to determine the getter/setter function.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-19 19:43 UTC]
Note that a similar RFC[1] has been declined.

[1] <>
 [2015-03-20 14:49 UTC]
-Status: Open +Status: Duplicate
 [2015-03-20 14:49 UTC]
This is a duplicate of bug #49526.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat May 15 06:01:24 2021 UTC