Req #69262 [Opn->Dup]: Native property-support

From: Date: Fri, 20 Mar 2015 14:49:58 +0000
Subject: Req #69262 [Opn->Dup]: Native property-support
References: 1  Groups: php.standards 
Request: Send a blank email to standards-+get-741@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69262&edit=1 ID: 69262 Updated by: levim@php.net Reported by: andreas dot prucha at gmail dot com Summary: Native property-support -Status: Open +Status: Duplicate Type: Feature/Change Request Package: PHP Language Specification PHP Version: Irrelevant Block user comment: N Private report: N New Comment: This is a duplicate of bug #49526. Previous Comments: ------------------------------------------------------------------------ [2015-03-19 19:43:56] cmb@php.net Note that a similar RFC[1] has been declined. [1] <https://wiki.php.net/rfc/propertygetsetsyntax-v1.2> ------------------------------------------------------------------------ [2015-03-19 11:13:17] andreas dot prucha at gmail dot com Description: ------------ 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69262&edit=1

« previous php.standards (#741) next »