note 17466 modified in language.variables.scope by jimw
| From: | jimw@php.net | Date: | Mon, 17 Dec 2001 03:37:03 +0000 |
| Subject: | note 17466 modified in language.variables.scope by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22959@lists.php.net to get a copy of this message | ||
When defining static variables you may use such declarations:
static $var = 1; //numbers
static $var = 'strings';
static $var = array(1,'a',3); //array construct
but these ones would produce errors:
static $var = some_function('arg');
static $var = 2+3; //any expression
static $var = new object;
--was--
When defining static variables you may use such declarations:
static $var = 1; //numbers
static $var = 'strings';
static $var = array(1,'a',3); //array construct
but these ones would produce errors:
static $var = some_function('arg');
static $var = 2+3; //any expression
static $var = new object;
[Ed: You can, however, use:
static $var = (some_function('arg'));
- irc-html ]
http://www.php.net/manual/en/language.variables.scope.php