Commit Graph

67837 Commits

Author SHA1 Message Date
Christoph M. Becker
6f5610ccc8
Fix ext/snmp for newer net-snmp versions on Windows (GH-15888)
As of net-snmp 5.8.0, the library defines their own `(v)asprintf()` if
not available on the system.  However, PHP also does this, so when
building ext/snmp there would be conflicting declarations on Windows.
To avoid this, we explictly define `HAVE_ASPRINTF`, so net-snmp does
not redeclare when its headers are included.
2024-09-20 23:59:17 +02:00
Niels Dossche
1b171bb6b4
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15918: Assertion failure in ext/spl/spl_fixedarray.c
2024-09-20 17:34:54 +02:00
Niels Dossche
9774cedb01
Fix GH-15918: Assertion failure in ext/spl/spl_fixedarray.c
SplFixedArray should've never get supported in ArrayObject because it's
overloaded, and so that breaks assumptions. This regressed in c4ecd82f.

Closes GH-15947.
2024-09-20 17:34:23 +02:00
Niels Dossche
7e6e71255e
Small optimization in dom_local_name_compare_ex() (#15950)
We can use `memcmp()` directly and skip some of the logic handling
in `zend_binary_strcmp()`. `perf record` shows a reduction for
`dom_html5_serializes_as_void()` from 3.12% to 0.77%.
2024-09-20 08:11:13 +02:00
Remi Collet
4cdba0511c
add ZipArchive::ER_TRUNCATED_ZIP added in libzip 1.11 (#15959) 2024-09-19 15:32:55 +02:00
Ilija Tovilo
1b9568d354
Implement backed enum coercion in http_build_query()
Fixes GH-15650
Closes GH-15704
2024-09-19 00:27:09 +02:00
Niels Dossche
7bf5b7fa78
Use cache slot for dom_property_exists() (#15941) 2024-09-18 17:23:24 +02:00
Michael Voříšek
d313ad6098
Deprecate E_STRICT constant and remove error level
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#remove_e_strict_error_level_and_deprecate_e_strict_constant

Closes GH-13053
2024-09-18 14:33:14 +02:00
Dmitry Stogov
a360b1757e
Add test for GH-15903 2024-09-18 09:35:01 +03:00
Dmitry Stogov
9cb48c8fa1
Update IR
IR commit: 84a4b4259a0ea246f82e0d8a3d79032af75b5267

This fixes GH-15903: Core dumped in ext/opcache/jit/ir/ir_ra.c
2024-09-18 09:33:54 +03:00
Jorg Adam Sowa
306dedcf5e
ext/bcmath: bcpow() performance improvement (#15790)
* Added function for squaring to improve performance of power calculation

* Aligned backslashes

* Removed unnecessary comments

* Extracted common part of multiplication and square functions

* Added comment to bc_fast_square

* Improved wording of bc_mul_finish_from_vector

* Reused new function name

* Replaced macro with function
2024-09-17 22:16:26 +02:00
Dmitry Stogov
36dfe634b0
Add test for GH-15909 (fixed by previous IR update) 2024-09-17 21:24:42 +03:00
Dmitry Stogov
718cff9bbb
Update IR
IR commit: 4f02f1bdc5b4312b862e5e399fe9fb1cfe149d0f
2024-09-17 21:24:01 +03:00
Niels Dossche
c9a4abadcc
Fix unsetting DOM properties
This never did anything in lower versions, but on master this crashes
because the virtual properties don't have backing storage. Just forbid
it since it was useless to begin with.

Closes GH-15891.
2024-09-17 19:24:49 +02:00
Gina Peter Banyard
ae4ef32d68
ext/standard/browscap.c: Minor refactorings (#15885)
- Use more appropriate types
- Add const modifiers
- Reduce scope of some variable
- Prevent shadowing of variable
2024-09-17 16:48:21 +01:00
Dmitry Stogov
1ce865244a
Update IR
IR commit: d441328849f5172e6ad213cf0e42d77322238048
2024-09-17 16:15:38 +03:00
Ayesh Karunaratne
3afb96184e ext/mbstring: Update to Unicode 16
Updates UCD to Unicode 16.0 (released 2024 Sept).

Previously: 0fdffc18, #7502, #14680

Unicode 16 adds several new character sets and case folding rules.
However, the existing ucgendat script can still parse them.

This also adds a couple test cases to make sure the new rules for
East Asian Wide characters and case folding work correctly. These
tests fail on Unicode 15.1 and older because those verisons do not
contain those rules.
2024-09-17 10:40:00 +09:00
DanielEScherzer
71edc05139
php_reflection.c: make a bunch of pointers const (#15927)
* php_reflection.c: make a bunch of pointers `const`

* _function_closure_string: use %u for unsigned

Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>

* _extension_class_string: make indent pointer `const`

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>

---------

Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
2024-09-17 03:17:46 +02:00
DanielEScherzer
65b4f22686
Fix some misleading comments about __clone() never being executed (#15926)
For the `Exception`, `ReflectionClass`, and `ReflectionAttribute` classes, the
`__clone()` method is declared to be private, and the implementation has a
comment that it should never be executed. However, the implementation can be
executed by using a `ReflectionMethod`. Fix the comments to instead explain why
the implementation is needed.

[skip ci]
2024-09-17 01:53:30 +02:00
Ilija Tovilo
2fce0bb877
Implement ReflectionProperty::isFinal()
Closes GH-15919
2024-09-16 23:22:52 +02:00
Niels Dossche
1ce07b0957
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15711: SoapClient can't convert BackedEnum to scalar value
  Use get_serialization_string_from_zval() in all encoding functions
  Introduce get_serialization_string_from_zval() and use it in to_xml_string()
2024-09-16 20:51:34 +02:00
Niels Dossche
25289dd08e
Fix GH-15711: SoapClient can't convert BackedEnum to scalar value
Allow SoapClient to use the backing value during response serialization.

Closes GH-15803.
2024-09-16 20:47:36 +02:00
Niels Dossche
ca66a11c36
Use get_serialization_string_from_zval() in all encoding functions 2024-09-16 20:46:52 +02:00
Niels Dossche
56fea5995d
Introduce get_serialization_string_from_zval() and use it in to_xml_string()
For now this new function only returns a copy of the string, but its
functionality will be expanded by later commits.
to_xml_string() now uses this function and the memory management is
simplified as well.
2024-09-16 20:46:52 +02:00
Niels Dossche
55aa5f3ffb
Fix GH-15910: Assertion failure in ext/dom/element.c 2024-09-16 20:06:07 +02:00
Arnaud Le Blanc
c65e042c0b
Fix zend_get_property_info_for_slot() for lazy objects (#15855)
zend_get_property_info_for_slot(obj, slot) assumes that 'slot' belongs to 'obj', but that may not be the case for lazy proxies.

Fortunately, the property info is often already available in path when it is needed.

For other cases, I make zend_get_property_info_for_slot() aware of lazy objects, and add zend_get_property_info_for_slot_self() for cases where the 'slot' is known to belong to the object itself.

Fixes oss-fuzz #71446
2024-09-16 16:58:12 +02:00
Ilija Tovilo
d75a289f6f
Implement ReflectionProperty::hasHook[s]
Closes GH-15844
2024-09-16 14:28:41 +02:00
Niels Dossche
ed54d6de49
Fix XML serializer errata: xmlns="" serialization should be allowed
The spec doesn't want to serialize xmlns:foo="", but the description of
the step that checks this does not take into account that xmlns="" must
be allowed. This patch corrects this errata.

Closes GH-15894.
2024-09-15 21:30:53 +02:00
Christoph M. Becker
5121acaa66
Support --with-openssl-argon2 on Windows (GH-15713)
We change the error for ZTS builds to a warning, to not break snapshot
builds which automatically will try to enable OpenSSL password hashing.

We also change some messages to better fit building on Windows.

And of course, we cannot easily check whether `OSSL_set_max_threads()`
is actually available; instead we're looking up the function declaration
in its header file.

Co-authored-by: Peter Kokot <peterkokot@gmail.com>
2024-09-15 17:06:50 +02:00
Máté Kocsis
274ae05c4e
Merge branch 'PHP-8.3'
* PHP-8.3:
  Add missing returns in ext/date for PHP 8.3+ (#15735)
2024-09-14 22:15:49 +02:00
Máté Kocsis
cb69900407
Add missing returns in ext/date for PHP 8.3+ (#15735)
Issues originally found in #15598
2024-09-14 22:15:22 +02:00
Gina Peter Bnayard
2513258a2b ext/phar: Voidify flush function as it always returns EOL 2024-09-14 14:00:46 +01:00
Gina Peter Bnayard
4f9fdf841e ext/phar: Move variable to inner scope 2024-09-14 14:00:46 +01:00
Gina Peter Bnayard
290fb920f2 ext/phar: Mark constant string as static const 2024-09-14 14:00:46 +01:00
Gina Peter Bnayard
3f1a4441bd ext/standard: Make char* of php_stristr() const 2024-09-14 14:00:46 +01:00
Gina Peter Bnayard
b75c79ee1d ext/phar: Use bool instead of int 2024-09-14 14:00:46 +01:00
Gina Peter Bnayard
03e2cfdad1 ext/phar: Refactor flushing of archive to only take string stub file 2024-09-14 14:00:46 +01:00
Peter Kokot
888eb370cf
Fix -Wundef/C4668 warnings (#15853)
- ZTS is either undefined or defined (to 1)
- PHP_WIN32 is either undefined or defined (to 1)
- HAVE_LIBEDIT is either undefined or defined (to 1)
2024-09-14 11:28:32 +02:00
Niels Dossche
e7b022ea17
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15868: Assertion failure in xml_parse_into_struct after exception
  Fix GH-15868: Assertion failure in xml_parse_into_struct after exception
2024-09-13 20:02:00 +02:00
Niels Dossche
6c82ca2182
Fix GH-15868: Assertion failure in xml_parse_into_struct after exception
Upon unwinding from an exception, the parser state is not stable, we
should not continue updating the values if an exception was thrown.

Closes GH-15879.
2024-09-13 20:01:44 +02:00
Ilija Tovilo
5e7a1cc818
Merge branch 'PHP-8.3'
* PHP-8.3:
  Mark some phar tests as flaky on macOS
2024-09-13 18:14:23 +02:00
Ilija Tovilo
5b2d80bc79
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Mark some phar tests as flaky on macOS
2024-09-13 18:14:14 +02:00
Ilija Tovilo
4e12189604
Mark some phar tests as flaky on macOS
Fixes GH-15748
Closes GH-15876
2024-09-13 18:13:10 +02:00
Gina Peter Banyard
f756b96e06
Make CSV deprecation less annoying to deal with (#15569) 2024-09-13 15:07:26 +01:00
Derick Rethans
fecad54d74
Backport fix from PHP 8.3: The exception handler already takes care of destroying the return value 2024-09-13 11:04:45 +01:00
Niels Dossche
cd232ed328
Fix short-lived phar regression
Regressed in 1facbc385a
The macro caused the value to be read over and over, but the change to
a variable makes the condition not work like before. Just inline the
read.
2024-09-12 23:16:49 +02:00
Niels Dossche
9f0138babe
Merge branch 'PHP-8.3'
* PHP-8.3:
  Update test for changed error message format in libxml 2.13
2024-09-12 23:11:28 +02:00
Niels Dossche
6f975a271f
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Update test for changed error message format in libxml 2.13
2024-09-12 23:11:23 +02:00
Niels Dossche
3354cc6e89
Update test for changed error message format in libxml 2.13 2024-09-12 23:11:14 +02:00
Niels Dossche
d5d06be3e3
Merge branch 'PHP-8.3'
* PHP-8.3:
  Update error message for libxml 2.13
  Update libxml test for the directory field behaviour change
2024-09-12 23:07:22 +02:00