#23537 [NEW]: Abstraction problem in Date class

From: Date: Thu, 08 May 2003 00:11:25 +0000
Subject: #23537 [NEW]: Abstraction problem in Date class
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-16043@lists.php.net to get a copy of this message
From: eddieajau at iprimus dot com dot au Operating system: WinXP PHP version: 4.3.2RC2 PHP Bug Type: PEAR related Bug description: Abstraction problem in Date class For the Date package maintainers I've found a slight flaw that prevents proper inheritance of the Date class if you are extending it (as I am to try and preserve the original Pear package as much as possible). For example, in the after method is the following line of code: if(Date::compare($this,$when) == -1) return true; If I have overloaded the compare method (which I have) then my extended class will fail. The compare method should be called like this to provide proper inheritance/overloading properties: if($this->compare($this,$when) == -1) return true; A similar, but much more extensive, problem exists if I want to create an extended Date_calc class. There are to many embedded Date_calc:xxx calls in the Date class to make this feasible and I am force to 'tweak' the Pear source (which I'd like to avoid). Could the Date_calc utility methods not be a part of the Date class itself? Regards, Andrew Eddie -- Edit bug report at http://bugs.php.net/?id=23537&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=23537&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=23537&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=23537&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=23537&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=23537&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=23537&r=support Expected behavior: http://bugs.php.net/fix.php?id=23537&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=23537&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=23537&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=23537&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23537&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=23537&r=dst IIS Stability: http://bugs.php.net/fix.php?id=23537&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=23537&r=gnused

« previous php.pear.dev (#16043) next »