1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Commit Graph

2756 Commits

Author SHA1 Message Date
Niels Dossche
ad5e182e0a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix crashes when trying to instantiate uninstantiable classes via date static constructors
2025-11-06 21:29:54 +01:00
Niels Dossche
ca084ac88a Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix crashes when trying to instantiate uninstantiable classes via date static constructors
2025-11-06 21:29:43 +01:00
Niels Dossche
d3a4b4b09c Fix crashes when trying to instantiate uninstantiable classes via date static constructors
Closes GH-20361.
2025-11-06 21:21:24 +01:00
Nicolas Grekas
fc353966f3 Revert deprecation of __sleep and __wakeup (#19966) 2025-10-06 10:30:27 +02:00
Gina Peter Banyard
4fbd2480bf ext/date: Deprecate __wakeup() methods in favour of __unserialize() (#19827)
The __wakeup() method is obsolete as a __unserialize() magic method is implemented.
Therefore, any class extending from those classes that overload deserialization should call the __unserialize() method instead of __wakeup() to properly handle the deserialization.

This deprecation follows the wording of the deprecation of the SplFixedArray::__wakeup() magic method.
2025-09-22 00:06:30 +01:00
Gina Peter Banyard
b4ed215299 core: Warn when non-representable floats are coerced to int (#19760)
RFC: https://wiki.php.net/rfc/warnings-php-8-5#casting_out_of_range_floats_to_int
2025-09-21 23:53:16 +01:00
Derick Rethans
42dc6aaee0 Merge branch 'PHP-8.4' 2025-09-15 10:40:45 +01:00
Derick Rethans
2e85c5f245 Merge branch 'PHP-8.3' into PHP-8.4 2025-09-15 10:39:56 +01:00
Derick Rethans
94dbdd03b7 Merge branch 'PHP-8.2' into PHP-8.3 2025-09-15 10:39:49 +01:00
Derick Rethans
a0329dbab0 Update timelib to 2022.14 2025-09-15 10:38:53 +01:00
Derick Rethans
62eaa71c4b Regenerate timelib parser files with --output <filename> 2025-09-11 13:16:58 +01:00
Gina Peter Banyard
a5f2eee785 Zend: Deprecate __wakeup() (#19435)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_sleep_and_wakeup_magic_methods
2025-09-11 06:57:21 +01:00
Daniel Scherzer
3f3a266a2b gen_stub: Infer constants' types from values (#19568)
Don't require `@var` with a type when the type can be inferred from a literal
value in the stub file.
2025-09-03 18:26:43 -07:00
Ilija Tovilo
e84393104a Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix date_sunrise() and date_sunset() with partial-hour UTC offset
2025-09-03 13:35:37 +02:00
Ilija Tovilo
73fc2db234 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix date_sunrise() and date_sunset() with partial-hour UTC offset
2025-09-03 13:35:04 +02:00
Ilija Tovilo
0ae9a58ade Fix date_sunrise() and date_sunset() with partial-hour UTC offset
See GH-19633
Closes GH-19672
2025-09-03 13:34:03 +02:00
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