note 63918 deleted from language.variables.scope by danbrown
| From: | danbrown@php.net | Date: | Mon, 18 May 2009 01:36:22 +0000 |
| Subject: | note 63918 deleted from language.variables.scope by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155561@lists.php.net to get a copy of this message | ||
Note Submitter: Rhett
----
You could get around that:
<?php
function someFunction () {
static $isInitialized = 0;
static $otherStatic = 0; // or whatever default you want
if (!$isInitialized) {
$otherStatic = function(); // or whatever
$isInitialized = 1;
}
...
}
?>
Needs an extra variable and evaluates a condition every time it's run, but it does get around
your problem.