Index: Date.php =================================================================== RCS file: /repository/pear/Date/Date.php,v retrieving revision 1.29 diff -u -r1.29 Date.php --- Date.php 5 Jan 2005 20:20:56 -0000 1.29 +++ Date.php 14 Mar 2005 22:38:44 -0000 @@ -36,6 +36,14 @@ /**@#-*/ /**@#+ + * Clone workaround for PHP 4 compatibility + */ +if (version_compare(phpversion(), '5.0') < 0) { + eval('function clone($object) {return $object;}'); +} +/**@#-*/ + +/**@#+ * Output formats. Pass this to getDate(). */ /** @@ -740,8 +748,10 @@ * @param object Date $d2 the second date * @return int 0 if the dates are equal, -1 if d1 is before d2, 1 if d1 is after d2 */ - function compare($d1, $d2) + function compare($_d1, $_d2) { + $d1 = clone($_d1); + $d2 = clone($_d2); $d1->convertTZ(new Date_TimeZone('UTC')); $d2->convertTZ(new Date_TimeZone('UTC')); $days1 = Date_Calc::dateToDays($d1->day, $d1->month, $d1->year);