PHP strtotime 性能问题
来源:互联网 发布:图解服务器端网络架构 编辑:程序博客网 时间:2024/04/28 23:17
转载:http://www.netingcn.com/php-strtotime-%E6%80%A7%E8%83%BD%E9%97%AE%E9%A2%98.html
在php中对一个有五万多个元素的数组进行遍历同时做一些简单的逻辑运算,发生耗时居然达到了13秒之多,通过排发现耗时的操作都是在strtotime上,使用strtotime把字符串“2012-02-22 10:07:34”转化为秒形式。开始以为就是strtotime的效率有问题,后来突然想起来,如果在PHP 5中,如果没有显式的设置timezone,php会有一个警告信息,猜测造成strtotime耗时的原因就是php需要处理警告,在php.ini中设置date.timezone = PRC 后在测试,果然不需要那么久了。
总结:在php 5后需要设置timezone,否则可能在进行日期、时间操作函数造成性能问题,另外在错误日志会出现大量的警告信息。
- PHP strtotime 性能问题
- PHP----->strtotime()
- php strtotime()
- PHP----->strtotime()
- 有关php下strtotime函数的问题
- PHP函数strtotime详解
- PHP函数strtotime详解
- php函数 strtotime
- PHP strtotime函数详解
- PHP strtotime() 函数
- php strtotime 周计算
- PHP strtotime函数详解
- PHP strtotime()函数
- PHP strtotime() 函数
- php strtotime()处理时间
- PHP date strtotime
- PHP strtotime() 函数
- [转]PHP函数strtotime详解
- Oracle内存全面分析(6)
- 在C++中子类继承和调用父类的构造函数方法
- CLAHE
- Android处理运行时更改
- Oracle内存全面分析(7)
- PHP strtotime 性能问题
- 简述GRASP设计原则
- Oracle内存全面分析(8)
- C#上传Excel文件报错,在最后一列添加异常列的方法
- mysql的query优化
- The Different Definitions between Concurrent processing and Asynchronous processing
- Ubuntu 类似Windows的资源管理器 gnome-system-monitor
- Oracle内存全面分析(9)
- fill_parent和match_parent的区别