note 76081 deleted from language.oop5.static by felipe
| From: | felipe@php.net | Date: | Mon, 24 Mar 2008 23:15:07 +0000 |
| Subject: | note 76081 deleted from language.oop5.static by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-137522@lists.php.net to get a copy of this message | ||
Note Submitter: yarco dot w at gmail dot com
----
Use a variable to initialize a static variable also trigger errors.
For example:
<?php
function test()
{
$t = time();
static $buf[] = $t; // this wouldn't work
}
?>
But you can do it seperatly:
<?php
function test()
{
static $buf;
$t = time();
$buf[] = $t;
}
?>