hi Stas, On Mon, Oct 4, 2010 at 1:27 AM, Stas Malyshev <smalys...@sugarcrm.com> wrote: > Hi! > >> It looks like a sub optimal choice to have used string constants >> instead of integer. However it could be still possible to define new >> constants as numeric. It is then possible to do whatever needs to be >> done as post or pre ops for the respective constants. > > I'm not sure what integers have to do with it? The constants define date > formats that are in common use, RFC2616 is one of the commonest on the web > and we don't have a constant for it...
I mean in ext/date and as a reply to Derick, not your request which is totally valid. A date time object has the timezone information. If the constants were integers, it would be very straightforward to do some operations before calling the formatting functions depending on a given predefined format. It should still be possible to do it by testing the string contents (strncmp), but that's not very clean. Cheers, -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php