From:             rolosworld at gmail dot com
Operating system: gentoo 
PHP version:      5.2.5
PHP Bug Type:     Date/time related
Bug description:  Incorrect time_t for x86-64

Description:
------------
Linux localhost 2.6.22-hardened-r8 #2 SMP Tue Dec 4 21:57:04 CST 2007
x86_64 Dual-Core AMD Opteron(tm) Processor 1210 AuthenticAMD GNU/Linux

Im having problems with the date functions, seems the time_t used by php
is 32bit, but the time_t of the system is 64bit.

PHP uses 64bit integers so php is compiled for 64bit.

To check the system time_t:

#include <cstdio>
#include <ctime>

int main ()
{
  printf ("Size of time_t %d.\n", sizeof(time_t));
  return 0;
}

g++ t.cpp -o t
OUTPUT:
Size of time_t 8.

g++ -m32 t.cpp -o t
OUTPUT:
Size of time_t 4.



Reproduce code:
---------------
<?php
echo "size: ",PHP_INT_SIZE,"\n";
echo "max: ",PHP_INT_MAX,"\n";
echo "mktime1: ",mktime(21,14,7,1,18,2038),"\n";
echo "mktime1: ",mktime(21,14,8,1,18,2038),"\n";
?>


Expected result:
----------------
size: 8
max: 9223372036854775807
mktime1: 2147483647
mktime2: 2147483648


Actual result:
--------------
size: 8
max: 9223372036854775807
mktime1: 2147483647
mktime2:


-- 
Edit bug report at http://bugs.php.net/?id=44296&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=44296&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=44296&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=44296&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=44296&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=44296&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=44296&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=44296&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=44296&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=44296&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=44296&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=44296&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=44296&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=44296&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=44296&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=44296&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=44296&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=44296&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44296&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=44296&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=44296&r=mysqlcfg

Reply via email to