php strtotime只传年,php strtotime在64位上给出不同的结果

我有名为_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

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值