|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-03-19 19:43 UTC] cmb@php.net
[2015-03-20 14:49 UTC] levim@php.net
-Status: Open
+Status: Duplicate
[2015-03-20 14:49 UTC] levim@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 09:00:01 2025 UTC |
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.