开发者

php step exceeds range, windows only with date('Y')

开发者 https://www.devze.com 2023-03-21 21:41 出处:网络
Out of interest, why on windows does this produce a warning (and returns false): range(date(\'Y\'), date(\'Y\') + 5)

Out of interest, why on windows does this produce a warning (and returns false):

range(date('Y'), date('Y') + 5)

Warning: range() [func开发者_StackOverflow中文版tion.range]: step exceeds the specified range

Doesn't happen on the live server, just windows. I've been looking for the bug report but haven't found one. Also, if you run two iterations, only the first one fails.

I can replicate sometimes but not others. ie. If I refresh say 20 times, only 2 or 3 of them will give the warning.

I'm using 5.3.5


Upgrading to 5.3.6 fixed this. Not sure what the problem was.


I am using PHP 5.3.2 under windows and I can't reproduce the problem. Everything is working fine and as expected. Maybe you have a other problem somewhere else leading to this error.

$a = range(date('Y'), date('Y') + 5);
print_r($a);

this prints:

Array
(
  [0] => 2011
  [1] => 2012
  [2] => 2013
  [3] => 2014
  [4] => 2015
  [5] => 2016
)
0

精彩评论

暂无评论...
验证码 换一张
取 消