Commit graph

2740 commits

Author SHA1 Message Date
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
Peter Kokot
f64c6248b5
Autotools: Update ax_check_compile_flag.m4 to serial 11 (#19127)
```sh
wget -O build/ax_check_compile_flag.m4 \
  https://cgit.git.savannah.gnu.org/cgit/autoconf-archive.git/plain/m4/ax_check_compile_flag.m4
```

New version of AX_CHECK_COMPILE_FLAG macro now adds the -Werror flag
automatically, if GNU-compatible compiler is detected.
2025-08-09 02:03:37 +02:00
Niels Dossche
99e6b0ecc8
Use stack allocation in timezone_initialize() (#19394)
This lives temporarily, avoid overhead and handling of heap allocation.
2025-08-08 20:29:39 +02:00
Gina Peter Banyard
aa9694bdd0
ext/date: null bytes in timezones can only happen via HT initialization (#19357)
Thus check this error condition early in the HT initialization code.
2025-08-06 21:02:25 +01:00
Daniel Scherzer
ff810d5e36
Arginfo: reuse zend_string objects for initializing attribute values (#19241)
Avoid initializing the same string content multiple times and make use of the
fact that the strings created to initialize attribute values are not freed by
simply making use of an existing zend_string with the same content if one is
available.
2025-07-27 17:27:22 -07:00
DanielEScherzer
1eadf553f1
Arginfo: avoid using temporary zvals for initializing attribute values (#19141)
Instead of
* adding a zval on the stack
* initializing it
* copying the value to the attribute

Just initialize the value directly in the zend_attribute_arg
2025-07-21 13:33:51 -07:00
Daniel Scherzer
142e378618 Arginfo: add and use known strings for attribute values 2025-07-14 17:31:22 -07:00
DanielEScherzer
9225cb45ac
Make zend_register_*_constant() functions return pointers, use them (#19029)
Have each of the specialized methods for registering a constant return a
pointer to the registered constant the same way that the generic
`zend_register_constant()` function does, and use those in the generated
arginfo files to avoid needing to search for a constant that was just
registered in order to add attributes to it.
2025-07-07 12:23:52 -07:00
Gina Peter Banyard
1b7f4567cb
ext/date: Fix tests (#18891) 2025-06-26 22:38:08 +02: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
Niels Dossche
0a2f367e19
Fix date test 2025-05-26 20:43:44 +02:00
Niels Dossche
cec079ee72
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix memory leak in tidy output handler on error
  Fix leaks with multiple calls to DatePeriod iterator current()
2025-05-26 19:42:39 +02:00
Niels Dossche
06f592820d
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix memory leak in tidy output handler on error
  Fix leaks with multiple calls to DatePeriod iterator current()
2025-05-26 19:42:20 +02:00
Niels Dossche
ff2c7dc0f8
Fix leaks with multiple calls to DatePeriod iterator current()
Destroy the old value first. We can't skip recreating the value because
the object may have been changed in between calls.

Closes GH-18624.
2025-05-26 19:40:41 +02:00
David CARLIER
4122daa494
ext/date: various array optimisations. (#18382) 2025-05-12 19:03:59 +01:00
David Carlier
c0371d3965
Merge branch 'PHP-8.4' 2025-05-03 19:40:28 +01:00
David Carlier
a7b78a5091
Fix ext/date: date_sunrise() new tests.
close GH-18489
2025-05-03 19:40:16 +01:00
David Carlier
0f6e18df8f
Merge branch 'PHP-8.4' 2025-05-03 16:56:55 +01:00
David Carlier
004d7cd290
Merge branch 'PHP-8.3' into PHP-8.4 2025-05-03 16:56:32 +01:00
David Carlier
0227d96f48
Fix GH-18481: date_sunrise check sun rise with offset if is finite/is nan
close GH-18484
2025-05-03 16:56:09 +01:00
Derick Rethans
7e1c8efa02
Merge branch 'PHP-8.4' 2025-04-22 17:11:32 +01:00
Derick Rethans
d54aee5b0c
Merge branch 'PHP-8.3' into PHP-8.4 2025-04-22 17:11:15 +01:00
Carlos Buenosvinos
c9f3127ca8
Fix GH-18076: date_sun_info() function returns inaccurate sunrise and sunset times
Closes GH-18317: Avoid double counting the 15 minutes radial correction of the sun
2025-04-22 16:45:57 +01:00
Niels Dossche
3ba725a556
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-18309: ipv6 filter integer overflow
  Fix GH-18304: Changing the properties of a DateInterval through dynamic properties triggers a SegFault
2025-04-11 23:36:42 +02:00
Niels Dossche
a019fbd970
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-18309: ipv6 filter integer overflow
  Fix GH-18304: Changing the properties of a DateInterval through dynamic properties triggers a SegFault
2025-04-11 23:36:12 +02:00
Niels Dossche
ba0853888d
Fix GH-18304: Changing the properties of a DateInterval through dynamic properties triggers a SegFault
For dynamic fetches the cache_slot will be NULL, so we have to check for
that when resetting the cache. For zip and xmlreader this couldn't
easily be tested because of a lack of writable properties.

Closes GH-18307.
2025-04-11 23:33:58 +02: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
Gina Peter Banyard
6ff9ca12d6 ext/date: Pack php_interval_obj
This reduces the size of the struct from 88 to 80 bytes.
2025-03-28 16:55:37 +00:00
Gina Peter Banyard
77c2fcf147 ext/date: Remove unused parameter 2025-03-28 16:55:37 +00:00
Gina Peter Banyard
8a3dbb0401 ext/date: Change return type of check_id_allowed from int to bool 2025-03-28 16:55:37 +00:00
Gina Peter Banyard
a4685d8b54 ext/date: Add const qualifiers 2025-03-28 16:55:37 +00:00
Gina Peter Banyard
c67e12e718 ext/date: Use Z_PARAM_ARRAY_HT instead of Z_PARAM_ARRAY 2025-03-28 16:55:37 +00:00
Derick Rethans
2d30c2e1ad
Updated to version 2025.2 (2025b) 2025-03-24 10:06:36 +00:00
Derick Rethans
22b2a579ba
Updated to version 2025.2 (2025b) 2025-03-24 10:06:34 +00:00
Derick Rethans
0c8a7a77a8
Updated to version 2025.2 (2025b) 2025-03-24 10:06:32 +00:00
Ilija Tovilo
bc32bb164f
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix flaky DatePeriod test
2025-03-06 15:04:36 +01:00
Ilija Tovilo
253c579c25
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix flaky DatePeriod test
2025-03-06 15:04:29 +01:00
Ilija Tovilo
a840a54fbc
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix flaky DatePeriod test
2025-03-06 15:04:18 +01:00
Ilija Tovilo
9256ee7b1b
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix flaky DatePeriod test
2025-03-06 15:04:08 +01:00
Ilija Tovilo
8a699372f2
Fix flaky DatePeriod test
$start and $end use the H:i:s from the current time. If $end happens on
a second boundary, $start + 4 days will include $end, thus performing an
extra iteration. Fix this by setting H:i:s to 00:00:00.
2025-03-06 15:01:30 +01:00
Niels Dossche
1ae2c871d0
Avoid unnecessary string refcounting in ext/date (#17890) 2025-03-02 22:55:06 +01:00
Niels Dossche
d95b9d6d32
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17736: Assertion failure zend_reference_destroy()
2025-03-02 22:41:21 +01:00
Niels Dossche
ee4a9a4a7c
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17736: Assertion failure zend_reference_destroy()
2025-03-02 22:37:07 +01:00
Niels Dossche
ce8ab5f16a
Fix GH-17736: Assertion failure zend_reference_destroy()
The cache slot for FETCH_OBJ_W in function `test` is primed with the
class for C. The next call uses a simplexml instance and reuses the same
cache slot. simplexml's get_property_ptr handler does not use the cache
slot, so the old values remain in the cache slot. When
`zend_handle_fetch_obj_flags` is called this is not guarded by a check
for the class entry. So we end up using the prop_info from the property
C::$a instead of the simplexml property.

This patch adds a reset to the cache slots in the property address fetch
code and also in the extensions with a non-standard reference handler.
This keeps the run time cache consistent and avoids the issue without
complicating the fast paths.

Closes GH-17739.
2025-03-02 22:33:32 +01:00
Derick Rethans
e64f674237
Updated to version 2025.1 (2025a) 2025-01-17 11:53:13 +00:00
Derick Rethans
4333009190
Updated to version 2025.1 (2025a) 2025-01-17 11:53:12 +00:00
Derick Rethans
7da1ea4029
Updated to version 2025.1 (2025a) 2025-01-17 11:53:10 +00:00
Christoph M. Becker
aac71904ca
Don't pass -fwrapv to clang on Windows (GH-17458)
This is apparently not supported there; the VS supplied clang version
18.1.8, reports:

`clang-cl: warning: unknown argument ignored in clang-cl: '-fwrapv' [-Wunknown-argument]`
2025-01-13 14:10:23 +01:00
David Carlier
76ade7165e
Merge branch 'PHP-8.4' 2024-12-20 15:09:59 +00:00