Req #49526 [Opn->Sus]: C# style property get/set syntax
| From: | cmb@php.net | Date: | Mon, 15 Mar 2021 16:51:35 +0000 |
| Subject: | Req #49526 [Opn->Sus]: C# style property get/set syntax | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-232744@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=49526&edit=1
ID: 49526
Updated by: cmb@php.net
Reported by: president at basnetworks dot net
Summary: C# style property get/set syntax
-Status: Open
+Status: Suspended
Type: Feature/Change Request
Package: Scripting Engine problem
Operating System: *
PHP Version: *
Block user comment: N
Private report: N
New Comment:
This is certainly a useful feature, but clearly requires the RFC
process[1]. Anybody is welcome to pursue this process. For the
time being, I suspend this ticket.
[1] <https://wiki.php.net/rfc/howto>
Previous Comments:
------------------------------------------------------------------------
[2015-03-21 15:48:32] andreas dot prucha at gmail dot com
I noticed that the RFC failed because it did not pass the 2/3-Limit, but got more than 50 %.
I would also like to see support for properties as I know them from Delphi/ObjectPascal. Basically
it's
property <propertyName> read <var-or-getter> write <var-or-setter>
In PHP I could imagine a syntax
property <propertyName> get <var-or-getter> set <var-or-setter>
for Example:
public property $foo get $bar set setFoo;
This means reading from $this->foo would read $bar directly, while writing to $this->foo would
call the method setFoo, passing the value.
Implementation in PhpDocumentor would also be quite easy.
------------------------------------------------------------------------
[2015-03-20 15:11:37] levim@php.net
Related To: Bug #54019
------------------------------------------------------------------------
[2015-03-20 15:02:39] levim@php.net
Related To: Bug #53229
------------------------------------------------------------------------
[2015-03-20 14:49:58] levim@php.net
Related To: Bug #69262
------------------------------------------------------------------------
[2013-03-02 18:36:32] reeze@php.net
@see https://wiki.php.net/rfc/propertygetsetsyntax-v1.2
this RFC failed to win the vote sadly.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=49526
--
Edit this bug report at https://bugs.php.net/bug.php?id=49526&edit=1