From: glashtin at sbcglobal dot net
Operating system: n/a
PHP version: 5CVS-2005-05-20 (dev)
PHP Bug Type: Feature/Change Request
Bug description: properties
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
--
Edit bug report at http://bugs.php.net/?id=33087&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33087&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=33087&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=33087&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33087&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33087&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33087&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33087&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33087&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33087&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33087&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=33087&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=33087&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33087&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33087&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33087&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33087&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33087&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33087&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33087&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33087&r=mysqlcfg