Home  >  Article  >  php教程  >  declaretest

declaretest

WBOY
WBOYOriginal
2016-08-04 08:54:491637browse

No detailsNo?php function profile($dump = FALSE){ static $profile; if($dump){ $temp = $profile;//Destroy the pointer unset ($profile); return ($temp); } //Current timestamp $profile[] = microtime(); }//The function to be run defined by declare register_tick_function("pro

a6ee57329d64b2d3f7d537174dc0338c d648d7d84be222d28bc97c69767ed12f
<?php
    function profile($dump = FALSE){
        static $profile;

        if($dump){
            $temp = $profile;
//销毁该指针
            unset ($profile);
            return ($temp);
        }
//当前时间戳
        $profile[] = microtime();
    }
//declare定义的要运行的函数
    register_tick_function("profile");

    profile();
 
//每运行两行代码执行一次  register_tick_function("profile");注册的函数。
    declare(ticks=2){
        for($x = 1; $x < 50; $x++){
            //计算两个数组的相似度--递归比较慢的操作
            echo similar_text(md5($x), md5($x * $x)), "<br />";
        }
    }

    print_r(profile (TRUE));
?>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn