1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 08:28:26 +02:00
Commit Graph

2334 Commits

Author SHA1 Message Date
Nikita Popov 902d64390e Deprecate implicit dynamic properties
Writing to a proprety that hasn't been declared is deprecated,
unless the class uses the #[AllowDynamicProperties] attribute or
defines __get()/__set().

RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties
2021-11-26 14:10:11 +01:00
Derick Rethans f893b55123 Merge branch 'PHP-8.1' 2021-11-18 13:56:07 +00:00
Derick Rethans e4679ef0c2 Fixed date/diff where the difference in hour is less than 1 2021-11-18 13:55:51 +00:00
Derick Rethans 369ab3b53e Merge branch 'PHP-8.1' 2021-11-08 09:40:41 +00:00
Derick Rethans 904933e918 Fixed bug #81458: Regression: Incorrect difference after timezone change 2021-11-08 09:40:27 +00:00
Derick Rethans 64bd602b6a Updated to version 2021.5 (2021e) 2021-11-03 15:49:27 +00:00
Derick Rethans 456bfc7e9e Updated to version 2021.5 (2021e) 2021-11-03 15:49:27 +00:00
Christoph M. Becker b7d90f09d4 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix #81500: Interval serialization regression since 7.3.14 / 7.4.2
2021-10-15 19:14:00 +02:00
Christoph M. Becker 2e65c8e581 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81500: Interval serialization regression since 7.3.14 / 7.4.2
2021-10-15 19:13:38 +02:00
Christoph M. Becker fc886694d3 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81500: Interval serialization regression since 7.3.14 / 7.4.2
2021-10-15 19:11:26 +02:00
Christoph M. Becker 866adb122a Fix #81500: Interval serialization regression since 7.3.14 / 7.4.2
While it may not be desired, `DateInterval::$f` supports negative
values, at least with regard to calculations.  We still need to guard
from assigning double values which are out of range for signed 64bit
integers (which would be undefined behavior).  zend_dval_to_lval() does
this by returning `0` instead of triggering UB.  This way we can avoid
setting the invalid marker, which doesn't work as expected anyway.

We must not do that only for unserialization, but also when the property
is set in the first place.

We need to adapt some of the existing tests wrt. this behavior.  In
particular, we check for an arbitrary value in bug79015.phpt, to cater
to differences between 32bit and 64bit architectures.

Closes GH-7575.
2021-10-15 19:08:07 +02:00
Hao Sun 2feecaf3f5 Merge branch 'PHP-8.1'
* PHP-8.1:
  Reduce threshold further in ext/date/tests/bug73837.phpt
2021-10-12 00:56:48 +00:00
Hao Sun 582e21fbda Reduce threshold further in ext/date/tests/bug73837.phpt
The threshold in test case ext/date/tests/bug73837.phpt has been reduced
several times, from the original 990 to current 400. However, this case
still failed on my local test with Mac Mini machine(macOS on Apple
silicon). Here is the diff result:

```
  $ cat ext/date/tests/bug73837.diff
     int(%d)
  002+ microseconds do not differ enough (268)
  002- microseconds differ
```

Hence this patch reduces the threshold further.

Note that this patch should be backported to PHP 8.1 branch as well.

Closes GH-7567.
2021-10-12 00:49:21 +00:00
Derick Rethans 21e8af8296 Merge branch 'PHP-8.1' 2021-10-08 13:52:47 +01:00
Derick Rethans 7af0bf4d07 Merge branch 'PHP-8.0' into PHP-8.1 2021-10-08 13:52:34 +01:00
Derick Rethans b230593b0e Merge branch 'PHP-7.4' into PHP-8.0 2021-10-08 13:52:18 +01:00
Derick Rethans 9733d49e14 Remove now superfluous tests due to changes in tzdata 2021-10-08 13:51:21 +01:00
Derick Rethans c8764870ae Updated to version 2021.3 (2021c) 2021-10-08 12:54:55 +01:00
Derick Rethans 7ad877ced1 Updated to version 2021.3 (2021c) 2021-10-08 12:54:54 +01:00
Derick Rethans c55b41d658 Updated to version 2021.3 (2021c) 2021-10-08 12:54:53 +01:00
Derick Rethans 8a61f1ece6 Updated to version 2021.3 (2021c) 2021-10-08 12:54:52 +01:00
Derick Rethans 8b55a84d00 Merge branch 'PHP-8.1' 2021-10-05 18:28:40 +01:00
Derick Rethans 6166ac51b7 Force UTC 2021-10-05 18:28:30 +01:00
Derick Rethans 0d6b8bbfcd Merge branch 'PHP-8.1' 2021-10-05 15:23:05 +01:00
Derick Rethans 68b874d10d Fixed bug #81504: Incorrect timezone transition details for POSIX data 2021-10-05 15:22:55 +01:00
Kamil Tekiela c3dda473cc Fix 'can not' in test data and in code comments 2021-10-05 09:51:58 +01:00
Christoph M. Becker f6ac832f0a [ci skip] Merge branch 'PHP-8.1'
* PHP-8.1:
  [ci skip] Remove erroneous XFAIL test
2021-10-01 18:59:54 +02:00
Christoph M. Becker c468e37858 [ci skip] Remove erroneous XFAIL test
Bug #66257 is actually not a bug, but rather a documentation issue.

Closes GH-7543.
2021-10-01 18:59:01 +02:00
Kamil Tekiela ca07cf3079 Merge branch 'PHP-8.1'
* PHP-8.1:
  getTimestamp does not return false
2021-09-30 09:16:25 +01:00
Kamil Tekiela 5fbba9b995 getTimestamp does not return false 2021-09-30 09:13:55 +01:00
George Peter Banyard 0663c64f41 Voidify php_date_interval_initialize_from_hash() 2021-09-29 17:15:50 +01:00
George Peter Banyard 492980c540 Use bool/zend_result instead of int in Date extension 2021-09-29 17:15:50 +01:00
Nikita Popov 9d8f97d58d Revert "Fix DATE_FORMAT_COOKIE definition"
This reverts commit ac34648cf6.

As pointed out on GH-6783, the new format doesn't match any of
the specified formats. Previously the constant generated

    Thursday, 14-Jul-2005 22:30:41 BST

which is obsolete. Now it generates

    Thu, 14-Jul-2005 22:30:41 BST

which is not specified at all. The correct version would be:

    Thu, 14 Jul 2005 22:30:41 BST

Reverting the change for now.
2021-09-29 09:26:40 +02:00
Mahmood Dhia ac34648cf6 Fix DATE_FORMAT_COOKIE definition
In all of http://curl.haxx.se/rfc/cookie_spec.html,
https://docs.microsoft.com/de-de/windows/win32/wininet/http-cookies
and https://tools.ietf.org/html/rfc7234#section-5.3 the cookie
datetime is specified as Mon, DD-Mon-YYYY HH:MM:SS GMT. However,
the current definition returns Monday, DD-Mon-YYY HH:MM:SS GMT.
Therefore, the "l" in "l, d-M-Y H:i:s T" must be changed to "D".

Closes GH-6783.
2021-09-23 16:01:04 +02:00
Christoph M. Becker fac3fbcb07 Fix OOB read due to timezone_open() with 5 digit offset
This has been reported as bug #78984, and is generally and properly
fixed as of timelib 2020.3 (PHP-8.0).  However, it is not fixed in
PHP-7.4, where the test results in an OOB read, and an unterminated
C string when calling `::getName()`.  Therefore, we apply a minimal
fix which just avoids this dangerous behavior.
2021-09-17 13:18:51 +02:00
Derick Rethans b0dd55b11c Fixed test - the expected result was wrong 2021-08-31 17:19:28 +01:00
Derick Rethans 2bf451b925 Upgrade timelib to 2021.08, which address some defects and performance
- Fixed bug #80998 (Missing second with inverted interval).
- Speed up finding timezone offset information.
2021-08-31 15:29:48 +01:00
Dmitry Stogov 6871a49b66 Fix timelib_parse_zone() performance problem.
This makes "new DateTimeZone("Europe/London");" 170 times faster.

This is a hotfix for https://github.com/derickr/timelib/pull/99
2021-08-31 15:29:05 +03: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
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 4aeff60f34 Upgrade timelib to version 2020.03 2021-08-08 12:11:18 +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