static_func

<?php 
function testing() {
    static $a = 1;
    $a *= 2;
    echo $a."\n";
}
testing(); //2
testing(); //4
testing(); //8

 

posted on 2015-07-15 18:13  yhdsir  阅读(134)  评论(0)    收藏  举报

导航