简体   繁体   中英

PHP 64bit on Windows and strtotime above 2038 not work

I'm aware of the year 2038 problem in PHP because of the 32bit limitation of integer values. I know that i need a 64bit system to make it working. Well, i've done so, i installed Apache 2.4.12 Win64 and PHP Version 5.6.6RC1 - Thread Safe 64bit for windows. I'm also on windows 7 64bit. And my problem is, strtotime still cannot handle dates higher than year 2038. Maybe there's a struggle in my head but i can't find the problem. I asking explicitly for strtotime , i know the solution of DateTime which is working, but i have old projects that uses lot of strtotime . Also i cannot get rid of the windows platform, it's just so here in our company :(

var_dump(strtotime("2038-11-01"));
// output: bool(false)

Edit1: I've tested php 7.0.0dev and here it works. Seems like i must wait for PHP7 to get proper 64bit on Windows. Luckily, 7.0.0dev seems right now pretty stable for me.

Edit2 : With PHP7 the problem doesn't exist anymore. It is not recommended anymore to use any 5.x branch.

Here is my phpinfo output 在此处输入图片说明

Please try the latest master snapshot, to grab here http://windows.php.net/downloads/snaps/master/ . Generally - it doesn't matter whether your windows is 64-bit itself. With PHP5 the underlying API is 32-bit for many things including time and integers. PHP7 (the master builds I've linked) have true 64-bit support.

Thanks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM