1
0
mirror of https://github.com/php/php-src.git synced 2026-04-03 22:22:18 +02:00
Commit Graph

2293 Commits

Author SHA1 Message Date
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
Derick Rethans
69fb3efe80 Fixed test by adding echo and expected string 2021-08-08 18:48:39 +01:00
Derick Rethans
d9c8e5a42e Fixed bug #80963: DateTimeZone::getTransitions() truncated 2021-08-08 17:27:21 +01:00
Derick Rethans
66ea59e38e Import timelib 2021.07
Fixes:
- Bug #80998 (Missing second with inverted interval). (Derick)
- Bug #81106 (Regression in 8.1: add() now truncate ->f). (Derick)
2021-08-08 17:22:06 +01:00
Derick Rethans
8426623521 Upgrade timelib to 2021.06
Fixes among others:
. Bug #79580 (date_create_from_format misses leap year).
. Bug #80974 (Wrong diff between 2 dates in different timezones).
. Bug #81097 (DateTimeZone silently falls back to UTC when providing an offset with seconds).
. Bug #81273 (Date interval calculation not correct).
2021-08-08 13:41:33 +01:00
Derick Rethans
84008782d3 Merge branch 'PHP-8.0' 2021-07-19 15:08:21 +01:00
Derick Rethans
9d0fb10823 Merge branch 'PHP-7.4' into PHP-8.0 2021-07-19 15:08:09 +01:00
Derick Rethans
26b1572d37 Move date timezone cache destruction to post deactivate
Some extensions try to use the date features in their own shutdown,
most notably some logging functions. Because of that, move the
cache tear down until after these resources have been cleaned up.
2021-07-19 15:07:01 +01: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
Patrick Allaert
ac18dd0dc7 Prefer EXPECT over EXPECTF 2021-06-29 17:13:02 +02:00
Patrick Allaert
aff365871a Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
Nikita Popov
6ce9076b2d Remove unnecessary skipifs in date 2021-06-14 15:35:48 +02:00
George Peter Banyard
b6958bb847 Implement "Deprecate implicit non-integer-compatible float to int conversions" RFC. (#6661)
RFC: https://wiki.php.net/rfc/implicit-float-int-deprecate

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-05-31 15:48:45 +01: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
George Peter Banyard
2f1d0f2bc3 Throw directly instead of replacing error handler in ext/date (#6954) 2021-05-07 11:10:39 +01:00
Nikita Popov
3b3f6de782 Use zend_string_concat3 in one place
A bit nicer than snprintf + passing the same length around three
times.
2021-05-07 10:43:40 +02:00
George Peter Banyard
2cd5a200f5 Refactor php_date_initialize_from_hash()
Use early returns
Formalize return type to bool
2021-05-06 21:48:52 +01:00
KsaR
01b3fc03c3 Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
George Peter Banyard
dcdc5d9069 Drop -Wno-implicit-fallthrough compiler flag
And add it back to ext/date, ext/hash, and ext/opcache
2021-04-19 13:59:18 +01:00
George Peter Banyard
5caaf40b43 Introduce pseudo-keyword ZEND_FALLTHROUGH
And use it instead of comments
2021-04-07 00:46:29 +01:00
Derick Rethans
4e3d469c4a Skip test on 32bit, as the timestamp range is outside 32bit range 2021-04-06 23:54:51 +01:00
Derick Rethans
091c0920b9 Upgrade timelib to 2021.03 and fix many date/time issues 2021-04-06 20:50:32 +01:00
George Peter Banyard
6acb079906 Use zend_string_equals() API instead of strcmp() in Date extension 2021-03-17 16:36:16 +00:00
Nikita Popov
08ad9af2ca Reduce date test threshold further
Still seeing the occasional spurious failure.
2021-03-05 16:31:24 +01:00
Nikita Popov
670b19af3e Reduce threshold in ext/date/tests/bug73837.phpt
Now that this code is faster, we're seeing many spurious failures.
2021-03-04 17:02:02 +01:00
Dmitry Stogov
b4e9b18463 Avoid useless date conversion 2021-03-04 12:27:31 +03:00
Dmitry Stogov
72c3ededed Change the order of properties used for var_dump(), serialize(), comparison, etc.
Now properties are ordered according to their layout in zend_object structure.
2021-03-01 13:29:49 +03:00
Máté Kocsis
bf0f6aaf18 Improve class entry generation
Related to GH-6701
2021-02-16 13:09:56 +01:00
Nikita Popov
eb8ad30cf1 Fix quadratic slowdown under asan in timelib
This is a hotfix for https://github.com/derickr/timelib/pull/94
until the issue is resolved upstream.
2021-02-16 11:56:17 +01:00
Nikita Popov
b10416a652 Deprecate passing null to non-nullable arg of internal function
This deprecates passing null to non-nullable scale arguments of
internal functions, with the eventual goal of making the behavior
consistent with userland functions, where null is never accepted
for non-nullable arguments.

This change is expected to cause quite a lot of fallout. In most
cases, calling code should be adjusted to avoid passing null. In
some cases, PHP should be adjusted to make some function arguments
nullable. I have already fixed a number of functions before landing
this, but feel free to file a bug if you encounter a function that
doesn't accept null, but probably should. (The rule of thumb for
this to be applicable is that the function must have special behavior
for 0 or "", which is distinct from the natural behavior of the
parameter.)

RFC: https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg

Closes GH-6475.
2021-02-11 21:46:13 +01: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
Derick Rethans
b67409e3d2 Updated to version 2021.1 (2021a) 2021-01-25 10:44:07 +00:00
Derick Rethans
fee80e397d Updated to version 2021.1 (2021a) 2021-01-25 10:44:06 +00:00
Derick Rethans
3f183bbcf8 Updated to version 2021.1 (2021a) 2021-01-25 10:44:05 +00:00
Nikita Popov
49e030d551 Merge branch 'PHP-8.0'
* PHP-8.0:
  Sync datefmt_get_calendar_object signature
  Sync intlcal_create_instance() and IntlCalendar::createInstance()
  Sync date_diff and DateTime::diff return type
2021-01-18 14:39:51 +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
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Máté Kocsis
74e39ce06c Merge branch 'PHP-8.0' 2020-12-28 14:46:00 +01:00
Máté Kocsis
46a2c6a8d7 Fix return type of DateTimeImmutable::__set_state() 2020-12-28 14:45:13 +01:00
Christoph M. Becker
bbae3dd7ff Merge branch 'PHP-8.0'
* PHP-8.0:
  DateTime*::getOffset() no longer returns false as of PHP 8.0.0
2020-12-26 15:13:56 +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
4050589302 Merge branch 'PHP-8.0'
* PHP-8.0:
  Add regression test for bug #76770
2020-12-23 16:47:32 +01:00
Semen Dubina
959d3c9636 Add regression test for bug #76770
Closes GH-3514.
2020-12-23 16:47:08 +01:00
Derick Rethans
5a3c1f61d4 Merge branch 'PHP-8.0' into master 2020-12-21 10:32:17 +00:00
Derick Rethans
288332077f Fixed bug #80376 (last day of the month causes runway cpu usage) 2020-12-21 10:31:41 +00:00
Derick Rethans
b043759cb4 Fixed bug #80376 (last day of the month causes runway cpu usage) 2020-12-21 10:30:40 +00: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