PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Date and Time » Date » Bug #3059

Variables defined outside the Date_Span class are not available

Details

Submitted2004-12-30 14:53 UTC
Froma dot schilder at gmx dot de
Assignedpajoye
StatusClosed
PackageDate
PHP Version5.0.0
OSWindows 2000
Roadmaps(Not assigned)

Comments

[2004-12-30 14:53 UTC] a dot schilder at gmx dot de

Description:
------------
We're using the __autoload function to load the date classes when needed. The __autoload functions uses an autoload class to include the required files.

Above the Date_Span class two varaibles are defined without using the $GLOBALS array - these variables are not available when the class is autoloaded (Notice: Undefined index: _DATE_SPAN_INPUT_FORMAT in [...]\Date\Span.php on line 243).

Simply use

$GLOBALS['_DATE_SPAN_FORMAT'] = '%C';
...
$GLOBALS['_DATE_SPAN_INPUT_FORMAT'] = DATE_SPAN_INPUT_FORMAT_NNSV;

(as in the other files) instead of

$_DATE_SPAN_FORMAT = '%C';
...
$_DATE_SPAN_INPUT_FORMAT = DATE_SPAN_INPUT_FORMAT_NNSV;

and all is fine;)

Bye,
Achim