summaryrefslogtreecommitdiff
path: root/ext/date/php_date.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix #74940: DateTimeZone loose comparison always trueChristoph M. Becker2020-03-301-0/+28
| | | | | | | | | | | | Since `DateTimeZone` does not implement a `compare_objects` handler, nor has any properties, two `DateTimeZone` instances always compare as being equal, even if they designate totally different timezones. Even worse, after calling `var_dump()` on these objects, the actual comparison may yield a correct result. We therefore introduce a `compare_objects` handlers, which prevents different behavior before/after `var_dump()`, and which allows us to clearly define the intended semantics.
* Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-03-191-0/+1
|\ | | | | | | | | * PHP-7.3: Fix #79396: DateTime hour incorrect during DST jump forward
| * Fix #79396: DateTime hour incorrect during DST jump forwardNate Brunette2020-03-191-0/+1
| | | | | | | | | | When you attempt to set the time to a non-existent time occuring during a DST jump forward, the hour does not move forward correctly.
* | Apply tidy formattingNikita Popov2020-02-031-1/+1
| | | | | | | | Mostly reindent PHP scripts to spaces.
* | Fix DatePeriod property handling with indirect modificationNikita Popov2020-01-301-4/+10
| | | | | | | | | | We do need to implement get_property_ptr_ptr to make arrays work correctly.
* | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-01-301-0/+1
|\ \ | |/ | | | | | | * PHP-7.3: Fix leak in DateTimeImmutable::modify()
| * Fix leak in DateTimeImmutable::modify()Nikita Popov2020-01-301-0/+1
| |
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-01-031-5/+7
|\ \ | |/ | | | | | | * PHP-7.3: Fix #79015: undefined-behavior in php_date.c
| * Fix #79015: undefined-behavior in php_date.cChristoph M. Becker2020-01-031-5/+7
| | | | | | | | | | | | We check that the given microsecond fraction is in the valid range [0, 1000000[, and otherwise mark it as invalid. We also drop the useless do loop; a plain block is sufficient here.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-10-281-6/+6
|\ \ | |/ | | | | | | * PHP-7.3: Fix #78751: Serialising DatePeriod converts DateTimeImmutable
| * Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-10-281-6/+6
| |\ | | | | | | | | | | | | * PHP-7.2: Fix #78751: Serialising DatePeriod converts DateTimeImmutable
| | * Fix #78751: Serialising DatePeriod converts DateTimeImmutableChristoph M. Becker2019-10-281-6/+6
| | | | | | | | | | | | | | | | | | When getting the properties of a DatePeriod instance we have to retain the proper classes, and when restoring a DatePeriod instance we have to cater to DateTimeImmutable instances as well.
* | | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-10-181-1/+15
|\ \ \ | |/ / | | | | | | | | | * PHP-7.3: Fix #70153 \DateInterval incorrectly unserialized
| * | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-10-181-1/+15
| |\ \ | | |/ | | | | | | | | | * PHP-7.2: Fix #70153 \DateInterval incorrectly unserialized
| | * Fix #70153 \DateInterval incorrectly unserializedm.yakunin2019-10-181-1/+15
| | | | | | | | | | | | | | | Added a separate macro for reading 'days' property, so that bool(false) is correctly converted to the proper internal representation.
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-09-191-1/+1
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-09-191-1/+1
| |\ \ | | |/
| | * Fix typoCJDennis2019-09-191-1/+1
| | | | | | | | | | | | `sizeof("data")-1` and `sizeof("date")-1` are both 4, so no change in behaviour
| * | Merge branch 'PHP-7.2' into PHP-7.3Joe Watkins2019-06-191-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.2: export php_time
| | * export php_timeJoe Watkins2019-06-191-1/+1
| | |
* | | Fixed bug #78383Nikita Popov2019-08-081-0/+2
| | |
* | | Merge branch 'PHP-7.3' into PHP-7.4Joe Watkins2019-06-191-9/+25
|\ \ \ | |/ / | | | | | | | | | * PHP-7.3: Resolve discrepencies between second value yielded by gettimeofday and time, fixes #69044
| * | Merge branch 'PHP-7.2' into PHP-7.3Joe Watkins2019-06-191-9/+25
| |\ \ | | |/ | | | | | | | | | * PHP-7.2: Resolve discrepencies between second value yielded by gettimeofday and time, fixes #69044
| | * Resolve discrepencies between second value yielded by gettimeofday and time, ↵Joe Watkins2019-06-191-9/+25
| | | | | | | | | | | | fixes #69044
* | | Cheaper checks for exceptions thrown from __toString()Dmitry Stogov2019-06-061-16/+20
| | |
* | | Allow exceptions in __toString()Nikita Popov2019-06-051-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC: https://wiki.php.net/rfc/tostring_exceptions And convert some object to string conversion related recoverable fatal errors into Error exceptions. Improve exception safety of internal code performing string conversions.
* | | Merge branch 'PHP-7.3' into PHP-7.4Craig Duncan2019-05-301-3/+34
|\ \ \ | |/ / | | | | | | | | | | | | * PHP-7.3: Add a test for bug #65672 Ensure the internal properties cannot be overwritten
| * | Merge branch 'PHP-7.2' into PHP-7.3Craig Duncan2019-05-301-3/+34
| |\ \ | | |/ | | | | | | | | | | | | * PHP-7.2: Add a test for bug #65672 Ensure the internal properties cannot be overwritten
| | * Ensure the internal properties cannot be overwrittenCraig Duncan2019-05-301-3/+34
| | |
* | | Specify get_property_ptr_ptr handler for DatePeriodNikita Popov2019-05-291-1/+10
| | | | | | | | | | | | | | | This handler is required on 7.4. Just return NULL from it to fall back to read_property.
* | | Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macrosDmitry Stogov2019-05-281-9/+10
| | |
* | | Make DateInterval objects uncomparableNikita Popov2019-04-231-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | Arbitrary DateInterval objects don't have well-defined comparison semantics. Throw a warning and treat the objects as uncomparable. Support for comparing DateInterval objects returned by DateTime::diff() may be added in the future.
* | | Merge branch 'PHP-7.3' into PHP-7.4Derick Rethans2019-04-171-0/+4
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Derick Rethans2019-04-171-0/+4
| |\ \ | | |/
| | * Fixed bug #77909: DatePeriod::__construct() with invalid recurrence count valueIgnace Nyamagana Butera2019-04-171-0/+4
| | | | | | | | | | | | | | | | | | Improve error message on invalid reccurence count Adding test when reccurence is -1
* | | Avoid time(NULL) call if explicit timestamp givenNikita Popov2019-04-081-2/+10
| | | | | | | | | | | | As suggested by Benjamin Coutu.
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-03-181-10/+9
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-03-181-2/+1
| |\ \ | | |/
| | * Fix unused variable warningNikita Popov2019-03-181-2/+1
| | |
| * | Merge branch 'PHP-7.2' into PHP-7.3Derick Rethans2019-03-171-10/+10
| |\ \ | | |/
| | * Fixed 7.2 compat issueDerick Rethans2019-03-171-10/+10
| | |
* | | Merge branch 'PHP-7.3' into PHP-7.4Derick Rethans2019-03-171-0/+23
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Derick Rethans2019-03-171-0/+23
| |\ \ | | |/
| | * Fixed bug #75113: Added DatePeriod::getRecurrences() method.Ignace Nyamagana Butera2019-03-171-0/+23
| | |
* | | Remove HAVE_STRFTIMEPeter Kokot2019-03-141-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Function strftime is part of the C89 standard [1] and current systems don't need to check for its presence anymore. Additionally, checks for strftime function in tests have been removed since the PHP strftime function is now always available. 1: https://port70.net/~nsz/c/c89/c89-draft.html
* | | Replace PHP_TM_GMTOFF with AC_CHECK_MEMBERSPeter Kokot2019-03-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes: - PHP_TM_GMTOFF removed - HAVE_TM_GMTOFF replaced with HAVE_STRUCT_TM_TM_GMTOFF - HAVE_TM_ZONE replaced with HAVE_STRUCT_TM_TM_ZONE - HAVE_TZNAME removed The PHP_TM_GMTOFF macro can be replaced with Autoconf's AC_CHECK_MEMBERS that defines the HAVE_STRUCT_TM_TM_GMTOFF symbol instead of the HAVE_TM_ZONE. The HAVE_TZNAME symbol is not used in current code. The obsolete HAVE_TM_ZONE symbol has been replaced with more proper HAVE_STRUCT_TM_TM_ZONE. These are defined by the AC_STRUCT_TIMEZONE macro.
* | | Merge branch 'PHP-7.3' into PHP-7.4Derick Rethans2019-02-281-2/+11
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Derick Rethans2019-02-281-2/+11
| |\ \ | | |/
| | * Fixed bug #50020 (DateInterval:createDateFromString() silently fails)Derick Rethans2019-02-281-2/+11
| | |
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-02-121-8/+1
|\ \ \ | |/ /