<?php | |
function counter() { | |
static $n = 10.0; | |
$n ++; | |
} | |
function initializeMe() { | |
static $alreadyCalled = false; | |
if ($alreadyCalled) return; | |
$alreadyCalled = true; | |
echo "Once!"; | |
} | |
function test() { | |
for ($i = 0; $i < 10000000; $i++) { | |
counter(); | |
initializeMe(); | |
} | |
} |