Hi!

> what do you think about improving the modification functionality of the 
> DateTime class. I always get a cold shiver, when I write something like this:
> <?php
> $date = new DateTime()
> $date->modify(‘+15 day’);
> 
> In my opinion it would be nicer if one could write:
> $date->modify(15, DateTime::INTERVAL_DAY); // for adding 15 days
> $date->modify(-15, DateTime::INTERVAL_DAY); // for subtracting 15 days

I think there's a very low value in a new API that does exactly what
existing API does but in slightly different way because of tastes of
some particular person. If you want to add something that is not
possible with existing API, it is welcome (given RFC, etc.) but just
adding small variations on the same theme would only add confusion and
if needed, can be very easily implemented in userspace.

-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to