From: Derick Rethans Date: Sat, 6 Mar 2010 16:04:47 +0000 (+0000) Subject: - Fixed bug #51096 ('last day' and 'first day' are handled incorrectly when X-Git-Tag: php-5.2.14RC1~110 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc2d11943effd2e46e288eb6a81b1328caa9c00d;p=php - Fixed bug #51096 ('last day' and 'first day' are handled incorrectly when parsing date strings). - For 5.2 I just added the test case minus new 5.3 additions. --- diff --git a/ext/date/tests/bug51096.phpt b/ext/date/tests/bug51096.phpt new file mode 100644 index 0000000000..6ad2d23cd9 --- /dev/null +++ b/ext/date/tests/bug51096.phpt @@ -0,0 +1,45 @@ +--TEST-- +Bug #51096: Test for "first day" vs "first day of". +--FILE-- +format( DateTime::ISO8601 ); + $date->modify( $test ); + echo ' -> ', $date->format( DateTime::ISO8601 ), "\n\n"; +} +?> +--EXPECT-- +first day +- month: 0; day: 1; first-day-of: false; last-day-of: false +- 2010-03-06T15:21:00+0000 -> 2010-03-07T15:21:00+0000 + +last day +- month: 0; day: -1; first-day-of: false; last-day-of: false +- 2010-03-06T15:21:00+0000 -> 2010-03-05T15:21:00+0000 + +next month +- month: 1; day: 0; first-day-of: false; last-day-of: false +- 2010-03-06T15:21:00+0000 -> 2010-04-06T15:21:00+0000 + +first day next month +- month: 1; day: 1; first-day-of: false; last-day-of: false +- 2010-03-06T15:21:00+0000 -> 2010-04-07T15:21:00+0000 + +last day next month +- month: 1; day: -1; first-day-of: false; last-day-of: false +- 2010-03-06T15:21:00+0000 -> 2010-04-05T15:21:00+0000