forp 是简单,非侵入式的,面向产品的 PHP 分析工具。forp 是轻量级的 PHP 扩展,提供 PHP 分析数据。
主要特性:
- 时间测量和每个函数的内存分配
- CPU 使用
- 函数调用的文件和行数
- 使用 Google Trace Event 格式输出
- 函数说明
- 函数分组
- 函数别名 (对匿名函数有用)
<?php// first thing to do, enable forp profilerforp_start(); // here, our PHP code we want to profilefunction foo(){ echo "Hello world !\n";}; foo(); // stop forp bufferingforp_end(); // get the stack as an array$profileStack = forp_dump(); print_r($profileStack);结果:
立即学习“PHP免费学习笔记(深入)”;
Hello world !Array( [utime] => 0 [stime] => 0 [stack] => Array ( [0] => Array ( [file] => /home/anthony/phpsrc/php-5.3.8/ext/forp/forp.php [function] => {main} [usec] => 94 [pusec] => 6 [bytes] => 524 [level] => 0 ) [1] => Array ( [file] => /home/anthony/phpsrc/php-5.3.8/ext/forp/forp.php [function] => foo [lineno] => 10 [usec] => 9 [pusec] => 6 [bytes] => 120 [level] => 1 [parent] => 0 ) ) )项目主页:http://www.open-open.com/lib/view/home/1431076898148
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号