我有名为_to_unix_timestamp()的php函数
编码 :
function _to_unix_timestamp($param){
if ($timestamp = strtotime($param)){
return $timestamp;
}
return (int) $param;
}
该代码在我的开发服务器(32位)上运行良好
但是当我在生产服务器(64位)中部署我的应用程序时
该函数的输出略有不同
例
// expected to be "int(1306400175)" but the output is "int(-56632154432)"
var_dump(_to_unix_timestamp("1306400175"));
在我的开发服务器上,输出为int(1306400175)
但在生产服务器上,输出为int(-56632154432)
只是信息
开发服务器(32位)=
Linux glustervm 2.6.18-164.el5xen#1 SMP 9月3日星期四04:47:32 EDT 2009 i686 i686 i386 GNU / Linux
PHP 5.2.9
生产服务器(64位)=
Linux minicapella 2.6.18-164.15.1.el5.centos.plusxen#1 SMP 2010年3月17日星期三20:32:20 EDT 2010 x86_64 x86_64 x86_64 GNU / Linux
PHP 5.2.13
现在我追加后该功能运行良好
//append "> 0"
if ($timestamp = strtotime($param) > 0){
但是,我想知道为什么输出不同?
谢谢你的建议
-rizkyabdilah