|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-01-09 04:08 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 20:00:01 2025 UTC |
Script to produce the problem: <? $TZ=":America/New_York"; $oldTZ = getenv("TZ"); putenv("TZ=$TZ"); $y = date("Z"); $x = date("Z"); echo "A: TZ= $TZ: GMTOFFSET = $y <BR>"; echo "B: TZ= $TZ: GMTOFFSET = $x <BR>"; putenv("TZ=$oldTZ"); $oldTZ = getenv("TZ"); putenv("TZ=$TZ"); $y = date("Z"); $x = date("Z"); echo "A: TZ= $TZ: GMTOFFSET = $y <BR>"; echo "B: TZ= $TZ: GMTOFFSET = $x <BR>"; putenv("TZ=$oldTZ"); ?> If you swap the lines (at the top of the script): $oldTZ = getenv("TZ"); putenv("TZ=$TZ"); to: putenv("TZ=$TZ"); $oldTZ = getenv("TZ"); the script works fine. My installation is RH6.2/apache 1.3.12/php4.0.2/mysql 3.22.23. I also have a database logging and replication layer as a module in php, but I had someone on the PHP GENERAL mailing list verify the bug on their setup. This appears to be a glitch in environment memory handling, but I can't be sure.