>  기사  >  php教程  >  선언 테스트

선언 테스트

WBOY
WBOY원래의
2016-08-04 08:54:491604검색

세부사항 없음 없음?php function profile($dump = FALSE){ static $profile; if($dump){ $temp = $profile;//포인터 삭제 unset ($profile) return ($temp) ; }//현재 타임스탬프 $profile[] = microtime() }//실행할 정의된 함수 선언 Register_tick_function("pro

fb08784bfd436155b783df87815b9776 1ac5ad9952dc79489dc410dee5818282
<?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));
?>
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.