Home » Date and Time » Date » Bug #967
Date_TimeZone uses a bad global variable
Details
| Submitted | 2004-03-08 03:30 UTC |
|---|---|
| From | redbeard at mdjohnson dot us |
| Assigned | pajoye |
| Status | Closed |
| Package | Date |
| PHP Version | Irrelevant |
| OS | All |
| Roadmaps | (Not assigned) |
Comments
[2004-03-08 03:30 UTC] redbeard at mdjohnson dot us
Description:
------------
The Date_TimeZone class uses the global variable $default as the default time zone object. It should be something like (according to PEAR guidlines) $_Date_default_time_zone.
It looks like you might be intending to use static class variables, which don't function as expected in PHP 4.x, IIRC. The above is probably best to use.
Reproduce code:
---------------
Date_TimeZone::setDefault('CST');
$tz = Date_TimeZone::getDefault();
echo "$tz->id\n";
$default = 'EST';
$tz = Date_TimeZone::getDefault();
echo "$tz->id\n";
Expected result:
----------------
CST
CST
Actual result:
--------------
CST
EST