From:             aeolianmeson at blitzeclipse dot com
Operating system: Windows XP SP2
PHP version:      5.2.3
PHP Bug Type:     *General Issues
Bug description:  touch() works incorrectly in Windows.

Description:
------------
Touch appears to always apply a timestamp that is exactly one-hour earlier
then the given timestamp, in Windows. It appears to work fine in PHP 5.0.4
and 4.1.2 in Linux.

Reproduce code:
---------------
touch('b', 0);

var_dump(stat('b'));

Expected result:
----------------
array(26) {
  [0]=>
  int(2)
  [1]=>
  int(0)
  [2]=>
  int(33206)
  [3]=>
  int(1)
  [4]=>
  int(0)
  [5]=>
  int(0)
  [6]=>
  int(2)
  [7]=>
  int(0)
  [8]=>
  int(-3600)
  [9]=>
  int(-3600)
  [10]=>
  int(1182374129)
  [11]=>
  int(-1)
  [12]=>
  int(-1)
  ["dev"]=>
  int(2)
  ["ino"]=>
  int(0)
  ["mode"]=>
  int(33206)
  ["nlink"]=>
  int(1)
  ["uid"]=>
  int(0)
  ["gid"]=>
  int(0)
  ["rdev"]=>
  int(2)
  ["size"]=>
  int(0)
  ["atime"]=>
  int(0)
  ["mtime"]=>
  int(0)
  ["ctime"]=>
  int(1182374129)
  ["blksize"]=>
  int(-1)
  ["blocks"]=>
  int(-1)
}

Actual result:
--------------
// mtime and ctime are -3600.

array(26) {
  [0]=>
  int(2)
  [1]=>
  int(0)
  [2]=>
  int(33206)
  [3]=>
  int(1)
  [4]=>
  int(0)
  [5]=>
  int(0)
  [6]=>
  int(2)
  [7]=>
  int(0)
  [8]=>
  int(-3600)
  [9]=>
  int(-3600)
  [10]=>
  int(1182374129)
  [11]=>
  int(-1)
  [12]=>
  int(-1)
  ["dev"]=>
  int(2)
  ["ino"]=>
  int(0)
  ["mode"]=>
  int(33206)
  ["nlink"]=>
  int(1)
  ["uid"]=>
  int(0)
  ["gid"]=>
  int(0)
  ["rdev"]=>
  int(2)
  ["size"]=>
  int(0)
  ["atime"]=>
  int(-3600)
  ["mtime"]=>
  int(-3600)
  ["ctime"]=>
  int(1182374129)
  ["blksize"]=>
  int(-1)
  ["blocks"]=>
  int(-1)
}

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

Reply via email to