|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-04-03 13:42 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 03:00:01 2025 UTC |
Description: ------------ I would like to see properties added to php like most other OOP languages have. The way I see it being used is class MyClass { private $FMyVar1 private $FMyVar2; property $MyVar1 read=$FMyVar1 write=$FMyVar1; property $MyVar2 read=$this->MyFunction(); write=$FMyVar2; private function MyFunction() { if ( $something ) $this->FMyVar2 = 'This'; else $this->FMyVar2 = 'That'; return $this->FMyVar2; } } Or something like that. I know there are work arounds but I would still like to see properties add so that I can clean up my code. In my opinion it looks better to use echo $MyClass->MyVar2; than echo $MyClass->MyFunction(); just a suggestion. Thanks