Commit Graph

137957 Commits

Author SHA1 Message Date
Christoph M. Becker
64d959e266
Merge branch 'PHP-8.3'
* PHP-8.3:
  [ci skip] Add labels to PRs with potential ABI breaks
2024-09-21 00:13:29 +02:00
Christoph M. Becker
dc20cabd82
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] Add labels to PRs with potential ABI breaks
2024-09-21 00:11:04 +02:00
Christoph M. Becker
170230f29b
[ci skip] Add labels to PRs with potential ABI breaks
ABI breaks are not supposed to happen after feature freeze, i.e. when
the PHP API numbers have been bumped.  To make it easier to notice
inadvertent ABI breaks, we automatically add an "ABI break" label to
all PRs which modify public (aka. installed) header files.  Some of
these modifications do not constitute an ABI break (e.g. adding a
comment to a header file), but we rely on natural intelligence to sort
that out.  That means these labels should be removed manually, if they
are not appropriate, but if they are, the PR should not be merged into
any stable branch.  For the master branch, where ABI breaks are
permissible, the labels should still be removed if irrelevant, but kept
when the PR is merged.

Since tests are futile[1], we leave that to further (test) PRs.

[1] <https://github.com/php/php-src/pull/15682#issuecomment-2323060586>

Closes GH-15682.
2024-09-21 00:09:30 +02:00
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
090b53bc44
[ci skip] NEWS + UPGRADING 2024-09-19 15:36:26 +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
Christoph M. Becker
7a8767fe62
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15901: phpdbg: Assertion failure on `i funcs`
2024-09-18 23:51:45 +02:00
Christoph M. Becker
c76913fde0
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15901: phpdbg: Assertion failure on `i funcs`
2024-09-18 23:50:20 +02:00
Christoph M. Becker
422aa17b9b
Fix GH-15901: phpdbg: Assertion failure on i funcs
New hash tables are not automatically packed, so we must not treat them
as such.  Therefore we guard the foreach appropriately.

Closes GH-15929.
2024-09-18 23:48:31 +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
Niels Dossche
e2da65de2a
NEWS for 306dedcf5e
[ci skip]
2024-09-17 22:17:34 +02: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
Niels Dossche
31e2ec63d8
Fix GH-15923: GDB: Python Exception <class 'TypeError'>: exceptions must derive from BaseException
Triggers on release builds when printing data structures.
You can't raise a string, you must raise exceptions.

Closes GH-15928.
2024-09-17 19:24:18 +02:00
Peter Kokot
43dc2eb6d8
Remove redundant *spell* libraries on Alpine (#15890)
These were needed mostly for the PHP <= 8.3 pspell extension. The
nchant2-hunspell gets installed automatically as a dependency with
enchant2-dev if needed.
2024-09-17 18:14:44 +02:00
Peter Kokot
2324e32c7d
Remove redundant Kerberos library installation (#15889)
This was once needed for the --with-kerberos configure options by
openssl or imap extensions.
2024-09-17 18:13:54 +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
Juliette
4830535b69
[skip ci] PHP 8.4 NEWS: fix typos in parameter names (#15931)
Ref: PR 15362 / c818d944cf (diff-7ee66c4f1536ac84dc5bbff1b8312e2eef24b974b3e48a5c5c2bcfdf2eb8f3ce)

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2024-09-17 16:47:08 +01:00
Arnaud Le Blanc
17d46bb3b2
Fix oss-fuzz #71382 (#15854)
The return value of zho_build_properties_ex() is passed to ZVAL_ARR(), which sets the IS_TYPE_REFCOUNTED flag. Returning &zend_emtpy_array will crash later when trying to dtor the zval.

I'm fixing this by returning zend_new_array(0) instead of &zend_empty_array.

An alternative was to make ZVAL_ARR() aware of immutable arrays, like ZVAL_STR() is with interned strings, but I found no other problematic cases.
2024-09-17 16:06:51 +02:00
Dmitry Stogov
1ce865244a
Update IR
IR commit: d441328849f5172e6ad213cf0e42d77322238048
2024-09-17 16:15:38 +03:00
DanielEScherzer
21196ca9f6
zend_enum.c: make a bunch of pointers const (#15932)
* zend_enum.c: make a bunch of pointers `const`

* interface_gets_implemented needs non-constant

* zend_enum.h: update zend_verify_enum() signature
2024-09-17 12:57:01 +02:00
DanielEScherzer
a3583d7eef
zend_inheritance.c: make a bunch of pointers const (GH-15934)
* zend_inheritance.c: make a bunch of pointers `const`

* Fix const double pointers
2024-09-17 12:44:17 +02:00
Ilija Tovilo
1be989bbf0
[skip ci] Move brew install libsodium to reinstall
Gets rid of the "already installed" warning on master.
2024-09-17 12:35:07 +02:00
Ayesh Karunaratne
5fa082316b
CI: Update actions/cache in nightly run to v4 (#15933) 2024-09-17 08:51:57 +02: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
c7397f5131
[skip ci] Fix NEWS section 2024-09-16 14:34:19 +02:00
Ilija Tovilo
d75a289f6f
Implement ReflectionProperty::hasHook[s]
Closes GH-15844
2024-09-16 14:28:41 +02:00
Christoph M. Becker
b438e2b1ed
Merge branch 'PHP-8.3'
* PHP-8.3:
  Run snmp tests in Windows CI, again
2024-09-15 23:15:09 +02:00
Christoph M. Becker
ad11cbc491
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Run snmp tests in Windows CI, again
2024-09-15 23:14:15 +02:00
Christoph M. Becker
b26e610777
Run snmp tests in Windows CI, again
That was broken when CI was moved to GH, since `APPVEYOR_BUILD_FOLDER`
is no longer set; instead we use `GITHUB_WORKSPACE` which has the same
meaning.

Closes GH-15896.
2024-09-15 23:13:54 +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