php bug,一个关于 PHP 奇怪的 Bug

一个应用的开始时间减去应用结束时的时间,小数点有时居然变成了逗号。

部分代码:

$mtime = explode(' ', microtime());

$app_starttime = $mtime[1] + $mtime[0];

/// 程序主体的运行

$mtime = explode(' ', microtime());

$app_endtime = $mtime[1] + $mtime[0];

$use_time = $app_endtime-$app_starttime;

fb($use_time, 'exec time');

if($use_time > 5){

Yf_Log::log($use_time, Yf_Log::ERROR,'slow_slow_log');

}

else if($use_time > 1){

Yf_Log::log($use_time, Yf_Log::ERROR,'slow_log');

}

else {

Yf_Log::log($use_time, Yf_Log::ERROR,'access_log');

}

记录的日志:

Dec 04 13:21:47 FILE=/data/www/www.xxx.com/index.php [error] 0.03904914855957

{"ctl":"Index","met":"index","typ":"e"}

#0 /data/www/www.xxx.com/index.php(211): Yf_Log::log(0.03904914855957,ERROR,access_log)

Dec 04 13:21:48 FILE=/data/www/www.xxx.com/index.php [error] 0.11846590042114

{"firstRow":"12","totalRows":"123","ctl":"Goods_Goods","met":"goodslist","act":"all","cat_id":"268","actorder":"desc","typ":"e","keywords":""}

#0 /data/www/www.xxx.com/index.php(211): Yf_Log::log(0.11846590042114,ERROR,access_log)

dic 03 23:25:05 FILE=/data/www/www.xxx.com/index.php [error] 0,018435955047607

{"typ":"json","lang":"es_CR","ctl":"Buyer_Voucher","met":"getVoucherCount","__random":"0.6502593521184687"}

#0 /data/www/www.xxx.com/index.php(211): Yf_Log::log(0,018435955047607,ERROR,access_log)

dic 03 23:25:05 FILE=/data/www/www.xxx.com/index.php [error] 0,035964965820312

{"typ":"json","lang":"es_CR","ctl":"Buyer_Index","met":"getAllCount","__random":"0.6859251245657769"}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值