note 24772 added to keyword.paamayim-nekudotayim
| From: | steven at caltech dot co dot uk | Date: | Wed, 28 Aug 2002 10:50:48 +0000 |
| Subject: | note 24772 added to keyword.paamayim-nekudotayim | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-35893@lists.php.net to get a copy of this message | ||
Re: jdominic@prodigy.net 08-Aug-2002 05:49
While it would be nice to have static instance variables you can simply create a method with the
same name which returns the value you require. This means you don't have to instantiate an
object when you only need its static content. For example:
class Colour {
function default () { return "black"; }
}
var $backgroundColour = Colour::default ();
--
http://www.php.net/manual/en/keyword.paamayim-nekudotayim.php
http://master.php.net/manage/user-notes.php?action=edit+24772
http://master.php.net/manage/user-notes.php?action=delete+24772
http://master.php.net/manage/user-notes.php?action=reject+24772