Re: date/timezone classes
| From: | Andi Gutmans | Date: | Thu, 07 Jul 2005 23:56:51 +0000 |
| Subject: | Re: date/timezone classes | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-17177@lists.php.net to get a copy of this message | ||
Hey Derick,
If you're just wrapping the date type with a class, I don't see why it shouldn't be a resource. It'd give you the same thing but would be easier to implement (unless I'm missing something).
I realize you personally aren't fond of OO but it actually would work very nicely with a Date class. I'm not talking about OO as in over-architecting and having a huge hierarchy but just having easy to use methods on the Date/TimeZone classes (one simple level).
It would look the following:
$timeZone->getName();
vs.
date_timezone_get($date);
$date->getOffset();
vs.
date_offset_get($date);
Personally, unrelated to OO I think it's a nicer and cleaner way of exposing such an API. It would also make it easier for some of the other new extensions like SimpleXML, SOAP, PDO , etc. to take advantage of it when exposing data types.
I think this should be seriously considered. I'll be happy to work with you on this if it makes sense to you and others.
I think that this functionality is best to be developed in parallel to 5.1. As it would be new unrelated functionality, I think we could introduce it in 5.1.x after 5.1.0 is out and once everyone feels comfortable with it. I don't think rushing it into 5.1.0 is a good idea especially if my feedback is considered.
Andi
At 11:10 PM 7/7/2005 +0200, you wrote:
Hei, I wrote up a little document about how I want to implement the date and timezone "class"es - although I'm not planning any OO methods. I'm just wrapping the timelib_time and timelib_tzinfo structures in an object. Let me know what you think. Derick -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php