Description:
------------
setcookie() will happily produce expires times with years greater than 4 digits in length. This violates various RFC's and can also lead to unexpectedly hung scripts (especially on 64-bit).
Reproduce code:
---------------
This works fine on 32-bit, but will keep the script looping effectively forever formatting the date as GMT on 64-bit.
setcookie('test', 'testing', PHP_INT_MAX);
Sample patch: http://evilcode.net/sjg/php5.2.6-setcookie-head.c.patch
This may not be the right place for this, as there are probably other violators as well. A more general/generic fix may be in order.
Expected result:
----------------
Date output should be trimmed to the end of year 9999, possibly a warning presented.

This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.