摘要:值 常量 描述 1 E_ERROR 致命的运行错误。错误无法恢复,暂停执行脚本。 2 E_WARNING 运行时警告(非致命性错误)。非致命的运行错误,脚本执行不会停止。 4 E_PARSE 编译时解析错误。解析错误只由分析器产生。 8 E_NOTICE 运行时提醒(这些经常是你代码中的bug引起的
阅读全文
摘要:Xdebug是一个开放源代码的PHP程序调试器(即一个Debug工具),可以用来跟踪,调试和分析PHP程序的运行状况。Xdebug现在的最新版本是Xdebug 2.4.0RC4,release日期 2016-01-25,添加了对PHP7的支持。 1.Xdebug安装 下载xdebug XDebug
阅读全文
摘要:set_time_limit(1200); ini_set('memory_limit', '1024M'); class PerformanceTest { private $time; private $memory; public function begin() { $this->time = $this->getTime(); ...
阅读全文
摘要:程序的执行效率很重要,低的执行效率意味着你需要在服务器硬件上有更多的投入,但是,最终的结果会因为你的程序执行效率低,连硬件也无法解决。下面几十个提高程序执行效率的小知识就有必要了解了解了。 1、 用单引号代替双引号来包含字符串,这样做会更快一些。因为 PHP 会在双引号包围的 字符串中搜寻变量,单引
阅读全文
摘要:function write_read(&$src,&$dst,$n) { $cnt = $n; $val = 0; while($cnt) { $dst = $val; $val = ($src) + 1; $cnt--; } } $loop = 0; $count = 0; $a = new Pe...
阅读全文
摘要:function minmax1(array $a,array $b,int $n) { for($i=0;$i$b[i]) { $t = $a[i]; $a[$i] = $b[$i]; $b[$i] = $t; } } } function minmax2(ar...
阅读全文
摘要:set_time_limit(1200); class PerformanceTest { private $time; private $memory; public function begin() { $this->time = $this->getTime(); $this->memory = $this->g...
阅读全文
摘要:function buildData(int $len){ $ret = []; if($len>0) { $ret['len'] = $len; for($i=0;$i<$len;$i++) { $ret['data'][] = mt_rand(1,2); } } return $ret;} de
阅读全文
摘要:set_time_limit(1200); class PerformanceTest { private $time; private $memory; public function begin() { $this->time = $this->getTime(); $this->memory = $this->getMe...
阅读全文
摘要:set_time_limit(1200); class PerformanceTest { private $time; private $memory; public function begin() { $this->time = $this->getTime(); $this->memory = $this->getMe...
阅读全文
摘要:json 需要操作太多 明显劣势于 (array)
阅读全文
摘要:Apache -- ab工具主要测试网站的(并发性能) 这个工具非常的强大。 基本语法 : cmd>ab.exe –n 请求总次数 -c 并发数 请求页面的url 进入到ab.exe目录 举例: cmd>ab.exe –n 10000 –c 100 http://localhost/test.php
阅读全文