Jorg Adam Sowa
25cbc15719
RFC: Deprecate date constant RFC7231 ( #12989 )
...
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_date_rfc7231_and_datetimeinterfacerfc7231
2025-08-12 11:33:38 +01:00
DanielEScherzer
171501b93f
Replace @deprecated
with #[\Deprecated]
for internal constants ( #18780 )
...
Only covers constants declared via stub files, others will be handled
separately in a later commit.
Does not include the intl extension, since that had some errors relating to the
cpp code; that extension will be updated separately.
2025-06-26 11:27:15 -07:00
Marc Bennewitz
3a14ce19a5
Fix stubs of DateTimeZone->getTransitions ( #17992 )
...
The default value of `timestamp_end` is INT32_MAX and not ZEND_LONG_MAX
2025-06-03 22:42:05 -07:00
Tim Düsterhus
5544be7018
RFC: Marking return values as important (#[\NoDiscard]) ( #17599 )
...
RFC: https://wiki.php.net/rfc/marking_return_value_as_important
Co-authored-by: Volker Dusch <volker@tideways-gmbh.com>
2025-04-02 09:35:29 +02:00
Máté Kocsis
181ea64cda
Reduce memory overhead of DatePeriod via virtual properties ( #15598 )
...
Related to https://github.com/php/php-src/issues/11644 and https://github.com/php/php-src/issues/13988
2024-09-27 22:54:40 +02:00
Jorg Adam Sowa
b9fef523c1
Deprecate date_sunrise and date_sunset constants ( #12978 )
...
RFC: https://wiki.php.net/rfc/deprecations_php_8_4
2024-08-04 20:07:52 +02:00
Tim Düsterhus
29f98e7485
Replace @deprecated
by #[\Deprecated]
for internal functions / class constants ( #14750 )
...
Co-authored-by: Gina Peter Banyard <girgias@php.net>
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2024-07-10 16:47:31 +02:00
Máté Kocsis
09303ad0e7
Fix some ext/date return types ( #14600 )
2024-06-18 23:25:09 +02:00
Jorg Adam Sowa
c4d9a37e81
Typed constants in date extension ( #12361 )
2024-05-22 13:17:44 +02:00
Marc Bennewitz
dbd976a67f
Singular DateTime::[get|set]Microsecond & no tentative return type ( #13486 )
...
* Singular DateTime::[get|set]Microsecond & no tentative return type
* Added missing getMicrosecond to DateTimeInterface
2024-03-06 09:18:22 +00:00
Marc Bennewitz
0016b3085c
Added DateTime[Immutable]::[get|set]Microseconds ( #12557 )
...
* Added DateTime[Immutable]::[get|set]Microseconds
2024-02-05 12:14:18 +00:00
Marc Bennewitz
88f2dc6268
Added DateTime[Immutable]::createFromTimestamp / date_create_[immutable]_from_timestamp
2023-11-22 15:24:13 +00:00
Ayesh Karunaratne
27fb8d1c0c
Fix DateTime exception hierarchy for DateInvalidTimeZoneException ( #11970 )
...
`DateInvalidTimeZoneException` is supposed to inherit from `DateException`, but the current stub has `Exception`.
2023-08-14 18:55:38 +02:00
Niels Dossche
17b3af2958
GH-11964: In ext/date/php_date.stub.php, DateRangeError extends itself
...
According to the RFC[1] it's supposed to extend DateError.
[1] https://wiki.php.net/rfc/datetime-exceptions
2023-08-14 13:57:09 +02:00
Máté Kocsis
9c7c0a0b93
Implement DatePeriod::createFromISO8601String()
2023-07-18 12:59:21 +02:00
Derick Rethans
b7860cd564
Implement More Appropriate Date/Time Exceptions RFC
2023-02-08 10:27:33 +00:00
Derick Rethans
6ae86c2358
Fixed bug #80022 : Support ISO 8601 years outside 0000-9999 range better
2022-07-22 15:34:57 +01:00
Máté Kocsis
e328c68305
Rename @cname to @cvalue in stubs ( #9043 )
...
@cname currently refers to the constant name in C. However, it is not always a (constant) name, but sometimes a function invocation, so naming it as @cvalue would be more appropriate.
2022-07-19 15:11:42 +02:00
Máté Kocsis
e13d60c039
DatePeriod properties cannot be made readonly ( #9013 )
2022-07-19 10:20:45 +02:00
Máté Kocsis
21fe72757c
Declare DatePeriod properties ( #8534 )
2022-05-28 08:43:10 +02:00
Máté Kocsis
14da1cb909
Add support for class constants in stubs ( #7434 )
2022-05-22 22:27:23 +02:00
Máté Kocsis
8b991b4ae4
Add static return type for DateTime*::createFrom*() when possible
...
Fix GH-8544
2022-05-13 12:13:48 +02:00
Máté Kocsis
37b3092820
Fix more specific return type hints for some ext/date methods
...
Ideally, these methods should have been declared with a static return type, so let's add a PHPDoc type hint + a TODO for fixing the issue in the future.
2022-05-13 11:18:26 +02:00
Derick Rethans
d54bcbb43b
Add DatePeriod's __serialize and __unserialize methods ( #8464 )
2022-05-03 22:06:17 +01:00
Derick Rethans
f869a546e7
Add DateInterval's __serialize and __unserialize methods
2022-04-29 10:27:38 +01:00
Derick Rethans
181623f9c0
Add DateTimeZone's __serialize and __unserialize methods
2022-04-29 09:44:27 +01:00
Derick Rethans
8b2ee5388c
Add DateTime/DateTimeImmutable's __serialize and __unserialize methods
2022-04-29 09:44:27 +01:00
Kamil Tekiela
5fbba9b995
getTimestamp does not return false
2021-09-30 09:13:55 +01:00
Máté Kocsis
1bf1481a2a
Specify a few array func info entries ( #7425 )
2021-08-30 14:29:18 +02:00
Máté Kocsis
8e6e9838b0
Add support for generating MAY_BE_ARRAY_OF_REF func info flag ( #7416 )
2021-08-30 13:50:34 +02:00
Máté Kocsis
5e424d2884
Fix a few ext/date return types
2021-08-26 15:26:13 +02:00
Máté Kocsis
2d248c80b9
Generate optimizer func info from stubs for ext/date ( #7403 )
2021-08-25 21:29:46 +02:00
Nikita Popov
4b3615a33f
Deprecate strftime() and gmstrftime()
...
These are deprecated in favor of date()/DateTime::format() (for
locale-indendent formatting) and IntlDateFormatter::format()
(for locale-dependent formatting).
Part of https://wiki.php.net/rfc/deprecations_php_8_1 .
2021-07-14 09:38:43 +02:00
Nikita Popov
5bb83b3778
Deprecate date_sunrise() and date_sunset()
...
date_sunrise() and date_sunset() are deprecated in favor of
date_sun_info().
Part of https://wiki.php.net/rfc/deprecations_php_8_1 .
2021-07-08 15:27:08 +02:00
Máté Kocsis
532c60cb92
Add support for tentative return types of internal methods
...
RFC: https://wiki.php.net/rfc/internal_method_return_types
Closses GH-6971
2021-05-14 15:55:25 +02:00
Máté Kocsis
99b08ac281
Implicitly enable function entry generation when class entry generation is enabled
...
Closes GH-6675
2021-02-09 13:37:24 +01:00
Máté Kocsis
5f21062054
Generate class entries for a few extensions
...
Relates to GH-6644
2021-02-03 09:24:09 +01:00
Nikita Popov
c31f9f7ee4
Sync date_diff and DateTime::diff return type
...
This function/method cannot return false.
2021-01-18 14:39:32 +01:00
Máté Kocsis
46a2c6a8d7
Fix return type of DateTimeImmutable::__set_state()
2020-12-28 14:45:13 +01:00
Christoph M. Becker
269936e680
DateTime*::getOffset() no longer returns false as of PHP 8.0.0
...
Cf. <https://github.com/php/doc-en/pull/282 >.
Closes GH-6539.
2020-12-26 15:13:05 +01:00
Christoph M. Becker
32c6c29d79
Revert "DateTime:: and DateTimeImmutable::getTimestamp() may return false"
...
This reverts commit b67c232189
.
2020-12-20 23:07:02 +01:00
Christoph M. Becker
b67c232189
DateTime:: and DateTimeImmutable::getTimestamp() may return false
2020-12-20 19:32:12 +01:00
Christoph M. Becker
3c68f43251
Fix ext/date stubs
...
Closes GH-6523.
2020-12-20 18:14:20 +01:00
Máté Kocsis
47bbfe1fc0
Require stubs to declare return types for magic methods when possible
...
Closes GH-6376
2020-10-23 16:33:16 +02:00
Máté Kocsis
d6264b0966
Verify parameter names of function aliases
...
Closes GH-6335
2020-10-16 10:56:33 +02:00
Máté Kocsis
186612e4d7
Improve parameter names in ext/intl
...
Closes GH-6309
2020-10-12 18:06:45 +02:00
George Peter Banyard
95f4ee38bb
Add some ValueErrors to ext/date
...
Closes GH-5613
2020-09-16 01:29:28 +02:00
Máté Kocsis
046cc5e4c2
Add another round of missing parameter types to stubs
...
Closes GH-5950
2020-08-07 16:48:45 +02:00
Derick Rethans
cdc8523300
Last pass of 'More consistent parameter names for date/time functions'
2020-07-27 11:42:13 +01:00
Derick Rethans
f66627abff
Another pass of improving ext/date argument names
2020-07-26 10:38:53 +01:00