Commit Graph

1723 Commits

Author SHA1 Message Date
Jakub Zelenka
98736e8bbd
Fix GH-13343: openssl_x509_parse should not allow omitted seconds in UTCTimes
Closes GH-14439

Signed-off-by: Jakub Zelenka <bukka@php.net>
2024-06-09 12:35:05 +01:00
Guillaume Outters
a9259c0496
Add Pdo\Pgsql::setNoticeCallback() (#14299)
This moves the new method from magically being added to the PDO class from the driver to just be available on the dedicated subclass. 

Drive-by fixes to NEWS and UPGRADING
2024-06-09 03:04:51 +01:00
Ayesh Karunaratne
d1f14a4609
ext/pcre: update to PCRE2 v10.44 (#14498)
Previously: GH-13413.

This version also contains a fix with `preg_match('\X')`, so that it
can correctly detect grapheme clusters (PCRE2Project/pcre2#410).
This is useful to correctly [polyfill the new `grapheme_str_split`
function](https://php.watch/versions/8.4/grapheme_str_split#polyfill).

Diff: pcre2lib [v10.43..v10.44](https://github.com/PCRE2Project/pcre2/compare/pcre2-10.43...pcre2-10.44)
2024-06-08 13:03:31 +02:00
David Carlier
7b2ca071c5
ext/gd: imagewebp/imageavif/imagepng/imagejpeg stricter checks quality/speed.
close GH-14485
2024-06-05 23:07:57 +01:00
Ayesh Karunaratne
c7366cf6a5
UPGRADING: move Opcache changes to the correct section (#14482)
[ci skip]

Signed-off-by: Ayesh Karunaratne <ayesh@aye.sh>
2024-06-05 20:31:32 +02:00
Niels Dossche
259744148e
Cache pcre subpattern table (#14424)
Recreating this over and over is pointless, cache this as well.
Fixes GH-14423.
2024-06-03 21:15:26 +02:00
David Carlier
e69bccd7c7
ext/pgsql: adding pg_socket_poll.
Using PQSocketPoll to poll on a connection's socket.
Returns immediatly is there no event expected on read and write.
Other than that, it is a thin wrapper on top of poll, thus reflecting
 its return value.

close GH-14366
2024-05-31 20:10:49 +01:00
Joshua Rüsweg
e4a8d5b16f
RFC: array_find (#14108)
see https://wiki.php.net/rfc/array_find
2024-05-31 19:39:12 +02:00
Gina Peter Banyard
cd44826c1a
[skip ci] Update UPGRADING after Intl refactoring 2024-05-30 13:02:44 +01:00
Niels Dossche
c7797fc8c0
Fix bug GH-11941: soap with session persistence will silently fails when "seession" built as a shared object (#14362)
This adds an optional dependency on the session extension and adds the
necessary APIs to make the functionality work with lazy binding.

This can be tested by configuring PHP with `--enable-session=shared` and
`--enable-soap=shared` and running the test suite, in particular the
buggy behaviour can be observed by the existing test `server009.phpt`.
2024-05-29 19:51:49 +02:00
Tim Düsterhus
8a87206211
reflection: Add ReflectionGenerator::isClosed() (#14358)
* reflection: Add `ReflectionGenerator::isClosed()`

see https://github.com/php/php-src/pull/14167#issuecomment-2133641998

* Fix test expectation

* Drop `{{{` / `}}}` comments around `ReflectionGenerator::isClosed()`
2024-05-29 19:07:09 +02:00
Peter Kokot
cb2c5de3db
Add PHP_SBINDIR (#13363)
The PHP_SBINDIR symbol was defined on *nix systems but never used. This
adds the constant similar to PHP_BINDIR also to PHP. On Windows it is
the value of prefix configuration when PHP was built (same value as
PHP_BINDIR).
2024-05-29 07:04:05 +02:00
David Carlier
162a311cc8
ext/pgsql: adding pg_put_copy_data/pg_put_copy_end.
pg_put_copy_data allows to send COPY commands to the server.
pg_put_copy_end signals the end of the n commands.

Both return 3 states ; 1, 0 and -1 when 1 is success, 0 the buffer queue
is full then -1 for errors.

Close GH-14325
2024-05-28 18:35:40 +01:00
Valentin Udaltsov
b6b16a1758
[RFC] Implement dereferencable for new exprs with constructor args
https://wiki.php.net/rfc/new_without_parentheses

Closes GH-13029
2024-05-28 00:23:12 +02:00
Manuel Mausz
5f2a0c8383
Add support for Curve25519 + Curve448 based keys
For openssl_pkey_get_details we export the priv+pub parameters.

ED25519/ED448 do not support streaming, so we need to use
EVP_Digest{Sign,Verify} instead. In general the older EVP_{Sign,Verify}
interface should be avoided as the key is passed very late.
See BUGS section in OpenSSL manpages of EVP_{Sign,Verify}Final

Additionally per requirement we need to allow sign/verify without
digest. So we need to allow passing 0 as digest. In OpenSSL 3.0+ this also
corresponds to the default digest (see EVP_PKEY_get_default_digest_name).

For CSR creation we need to allow "null" as digest_alg option.

Closes GH-14052
2024-05-27 12:52:57 +01:00
Jorg Sowa
23afe57f01
Added deprecation Division by zero when using power with zero as base and negative exponent
RFC: https://wiki.php.net/rfc/raising_zero_to_power_of_negative_number

Closes GH-13128
2024-05-22 15:05:47 +02:00
Guillaume Outters
c265b9085a
ext/pdo_pgsql: adding pgsqlSetNoticeCallback
Allows a callback to be triggered on every notice sent by PostgreSQL.

Such notices can be sent with a RAISE NOTICE in PL/pgSQL; in a long running
stored procedure, they prove useful as realtime checkpoint indicators.

close GH-6764
2024-05-22 12:32:11 +01:00
Jorg Adam Sowa
c4d9a37e81
Typed constants in date extension (#12361) 2024-05-22 13:17:44 +02:00
Tim Düsterhus
8094bd1b58
Make ReflectionGenerator::getFunction() legal after generator termination (#14167)
* Make `ReflectionGenerator::getFunction()` legal after generator termination

* Expose the generator function name via `Generator::__debugInfo()`

* Allow creating `ReflectionGenerator` after termination

* Reorder `struct _zend_generator` to avoid a hole

* Adjust `ext/reflection/tests/028.phpt`

This is legal now.

* Fix Generator Closure collection

* Add test to verify the Closure dies with the generator

* NEWS / UPGRADING
2024-05-21 08:54:51 +02:00
Niels Dossche
90e0ce7f0d
Throw early when a non-stream-context resource is passed to libxml_set_streams_context() (#14279) 2024-05-20 16:56:38 +02:00
David Carlier
9aa3a0d702
ext/pgsql: adding pg_change_password functionality.
handy call to change an user password while taking care transparently
of the password's encryption.

close GH-14262
2024-05-20 12:57:37 +01:00
武田 憲太郎
b7dd3d8347
ext/pdo_pgsql: Retrieve the memory usage of the query result resource (#14260)
`getAttribute()` can now retrieve the memory usage of query results.
`PDO::PGSQL_ATTR_RESULT_MEMORY_SIZE` was added for this feature.

closes #14260
2024-05-20 09:08:54 +09:00
武田 憲太郎
77fa4c0fce
ext/pgsql: add pg_result_memory_size
Close GH-14214
2024-05-13 22:58:02 +01:00
Niels Dossche
aa3e6eec50
Optimize and reduce memory usage of XML serialization (#14204)
The serialization process uses the system allocator and requires a copy
to request allocated memory once finished. This patch improves this by
using smart_str to build the resulting string, reducing the number of
copies and reducing total peak memory usage.
2024-05-12 01:57:29 +02:00
Niels Dossche
2956f55d17
[ci skip] UPGRADING: Update capitalization of Dom namespace 2024-05-09 12:47:39 +02:00
Niels Dossche
25860ee670
[ci skip] UPGRADING: Expand upon BCMath performance improvements 2024-05-09 12:46:42 +02:00
Máté Kocsis
920591064e Migrate SOAP table resource to array
Related to https://wiki.php.net/rfc/resource_to_object_conversion and https://github.com/php/php-tasks/issues/6
2024-05-08 22:48:19 +02:00
Máté Kocsis
60336de2ba Migrate SOAP SDL resource to object
Related to https://wiki.php.net/rfc/resource_to_object_conversion and https://github.com/php/php-tasks/issues/6
Closes GH-14121
2024-05-07 09:21:39 +02:00
Máté Kocsis
44b3cb2a13 Migrate SOAP URL resource to object
Related to https://wiki.php.net/rfc/resource_to_object_conversion and https://github.com/php/php-tasks/issues/6
2024-05-07 09:21:39 +02:00
Niels Dossche
f97bd071d5
Implement SeekableIterator for SplObjectStorage (#13665) 2024-05-05 13:26:54 +02:00
Niels Dossche
b1bb9c34e8
[ci skip] NEWS and UPGRADING 2024-05-01 16:57:36 +02:00
Saki Takamachi
10ae87969e
NEWS/UPGRADING 2024-05-01 22:02:43 +09:00
Tim Düsterhus
b5ffac7f6a
Add ReflectionClassConstant::isDeprecated() (#14086)
This is in preparation for php/php-src#11293 and for consistency with
ReflectionConstant::isDeprecated() that was added in php/php-src#13669.
2024-04-30 17:26:27 +02:00
Ilija Tovilo
cb55588a7e
Skip online tests by default
Fixes GH-14058
Closes GH-14070
2024-04-30 14:10:46 +02:00
David Carlier
1cf4cc3894
ext/intl: IntlDateFormatter::parseToCalendar addition.
Unlike IntlDateFormatter::parse, the timezone is updated
accordingly.

Close GH-13779
2024-04-29 18:55:00 +01:00
Máté Kocsis
afd91fb9ac
Migrate ext/odbc resources to opaque objects (#12040)
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2024-04-28 15:45:56 +02:00
David CARLIER
d5d227a43a
[ci skip] ext/sockets: followup on #14065. (#14066)
freebsd supports SO_NOSIGPIPE too.
2024-04-28 13:01:49 +01:00
David Carlier
b147a22bb8
ext/sockets: adding SO_NOSIGPIPE constant.
it s the macOs way to disable the SIGPIPE signal emission, same
 as doing `signal(SIGPIPE, SIG_IGN)` but on the socket level.

Close GH-14065
2024-04-28 12:01:03 +01:00
Gina Peter Banyard
f68d72527a UPGRADING 2024-04-24 15:39:47 +01:00
Niels Dossche
a70786304b
[ci skip] UPGRADING 2024-04-24 09:10:13 +02:00
Arnaud Le Blanc
6d285e3d08
[ci skip] UPGRADING 2024-04-23 11:58:51 +02:00
David Carlier
3a300e9213
ext/pcntl: signals list update for dragonflybsd related to checkpoint.
- SIGCKPT checkpoint and continue.
- SIGCKPTEXIT checkpoint and exit.

Close GH-14011
2024-04-22 21:21:52 +01:00
Laurent Arnoud
3f0b204f5a
cli: allow to change ~/.php_history with PHP_HISTFILE
Closes GH-13313
2024-04-22 10:05:47 +02:00
Niels Dossche
7428a92c5b
[ci skip] Be more specific about ext-dom incompatibilities in UPGRADING (#14024)
The previous text was put there before I decided to add the new classes.
Therefore the only new feature that can affect BC is
compareDocumentPosition(). Only when the declaration is incompatible can
the user experience errors.
2024-04-20 23:21:40 +02:00
Ilija Tovilo
e23440e5a6
Implement reflection constant
Fixes GH-13570
Closes GH-13669
2024-04-17 22:53:09 +02:00
David Carlier
d40726670f
ext/pcntl: pcntl_getqos_class/pcntl_setqos_class addition.
Introducting macOs Quality Of Service through those two calls.
on macOs arm64/M*, there is no concept of individual cores, thus
the old thread policy for cpu affinity does not work here.
Instead, the user can apply to the current process the level of
 performance/energy consumption they wish from the highest
QosClass::UserInteractive to QosClass::Background.

Close GH-13945
2024-04-15 18:52:28 +01:00
Niels Dossche
6df8111a8d
[ci skip] UPGRADING
Reorganize performance section.
Add performance entry for GH-13041.
2024-04-14 13:59:47 +02:00
Tim Düsterhus
08b2ab22f4
Include the source location in Closure names (#13550)
* Include the source location in Closure names

This change makes stack traces involving Closures, especially multiple
different Closures, much more useful, because it's more easily visible *which*
closure was called for a given stack frame.

The implementation is similar to that of anonymous classes which already
include the file name and line number within their generated classname.

* Update scripts/dev/bless_tests.php for closure naming

* Adjust existing tests for closure naming

* Adjust tests for closure naming that were not caught locally

* Drop the namespace from closure names

This is redundant with the included filename.

* Include filename and line number as separate keys in Closure debug info

* Fix test

* Fix test

* Include the surrounding class and function name in closure names

* Fix test

* Relax test expecations

* Fix tests after merge

* NEWS / UPGRADING
2024-04-12 18:21:13 +02:00
Máté Kocsis
843946a867
Add upgrading note for the "Dedicated StreamBucket class" RFC
[skip-ci]
2024-04-11 20:16:54 +02:00
Máté Kocsis
4a0ec3de46
Make ext/odbc default value handling more consistent (#13910)
These changes are carved off from https://github.com/php/php-src/pull/12040/files. I noticed that there are some inconsistencies between odbc_fetch_object()/odbc_fetch_array(), odbc_fetch_into(), as well as odbc_fetch_row(), specifically in how they handle the $row parameter. Now, I tried to align their behaviour the following way:

- I made null the default value. Previously, the default values were one of the following: -1, -1, 0, and null, respectively.
- odbc_fetch_row() has been returning false indicating there is no more rows when 0 is passed as $row. Now, a warning is also emitted in this case, because the null default value is not new, because it's available since PHP 8.0.
- When HAVE_SQL_EXTENDED_FETCH is not defined, the $row parameter is always ignored. Previously, some of the functions didn't accept it at all. Now a warning is emitted if the feature is not supported, but the parameter has any meaningful value (is greater than or equal to 1).
2024-04-10 22:49:41 +02:00
David Carlier
0e16e29b40
ext/sockets: socket_create_listen update.
going from 128 to system's SOMAXCONN by default to be able to increase
the queue of connections to be handled.
Also, for Haiku SOMAXCONN is only 32.

Close GH-13854
2024-04-10 18:39:38 +01:00
Yuya Hamada
44e8301cf6
Add grapheme_str_split function
I noticed that PHP does not have a grapheme cluster based str_split function.
So I created the grapheme_str_split function.

This feature will allow you to correctly handle emoji
and variable selectors.

Co-authored-by: Ayesh Karunaratne <Ayesh@users.noreply.github.com>

Close GH-13580
2024-04-10 18:20:23 +01:00
Saki Takamachi
fc14f17a20
remove ZWSP 2024-04-10 10:02:24 +09:00
David Carlier
645af9fb17
ext/sockets: adding solaris/illumos SO_EXCLBIND constant.
when set to "true", neutralises the effect of SO_REUSEADDR/SO_REUSEPORT
making the socket binding exclusive.

Close GH-13912
2024-04-09 21:41:22 +01:00
David Carlier
db2869346c
ext/posix: posix_isatty set errno for it too.
Close GH-13918
2024-04-09 17:34:03 +01:00
David Carlier
d8f2900574
ext/pcntl: adding pcntl_getcpu.
using sched_getcpu under the hood (Linux and FreeBSD).
Returns the current cpu id for the current process.
For Linux, we need to see beyond the sole presence of the symbol
to consider it.
Mostly useful, for now, in the cpu affinity context since
the os can migrate processes as it sees fits otherwise.

Clos GH-13908
2024-04-07 20:05:03 +01:00
David Carlier
1cf8291c85
ext/pcntl: cpu affinity api introduction.
For now, working on Linux, FreeBSD >= 13.x and DragonFlyBSD.
Handy wrapper to assign an array of cpu ids or to retrieve the cpu ids
assigned to a given process.

pcntl_setaffinity inserts valid unique cpu ids (within the range of available
cpus).

Close GH-13893
2024-04-07 00:56:54 +01:00
David Carlier
ae4978a139
ext/pcntl: adding pcntl_setns for Linux >= 5.3
allows a given process to join an existing Linux namespace, relatively
complementary to the existing pcntl_unshare.

Close GH-13878
2024-04-04 18:45:15 +01:00
Niels Dossche
30885f3b5f
Implement request #71571: XSLT processor should provide option to change maxDepth (#13731)
There are two depth limiting parameters for XSLT templates.
1) maxTemplateDepth
   This corresponds to the recursion depth of a template. For very
   complicated templates this can be hit.
2) maxTemplateVars
   This is the total number of live variables. When using recursive
   templates with lots of parameters you can hit this limit.

This patch introduces two new properties to XSLTProcessor that
corresponds to the above variables.
2024-03-31 21:21:23 +02:00
David Carlier
b82024b13c ext/sockets: adding Linux's TCP_SYNCNT constant.
Useful to control how many SYN packets the client will send to the
server before giving up establishing a connection if the server does
not respond (usually 5 or 6 by default).

Close GH-13816
2024-03-29 14:52:53 +00:00
Remi Collet
6c5814dade
revert base64_encode change 2024-03-27 08:08:43 +01:00
Remi Collet
dd6e738fe4
[ci skip] NEWS for base64_encode 2024-03-26 13:50:31 +01:00
Ayesh Karunaratne
3de3e137bf ext/openssl: Bump minimum required OpenSSL version to 1.1.1
Bumps the minimum required OpenSSL version from 1.0.2 to 1.1.1.

OpenSSL 1.1.1 is an LTS release, but has reached[^1] EOL from upstream. However, Linux distro/OS vendors
continue to ship OpenSSL 1.1.1, so 1.1.1 was picked as the minimum. The current minimum 1.0.2 reached
EOL in 2018.

Bumping the minimum required OpenSSL version makes it possible for ext-openssl to remove a bunch of
conditional code, and assume that TLS 1.3 (shipped with OpenSSL 1.1.1) will be supported everywhere.

 - Debian buster: 1.1.1[^2]
 - Ubuntu 20.04: 1.1.1[^3]
 - CentOS/RHEL 7: 1.0.2
 - RHEL 8/Rocky 8/EL 8: 1.1.1
 - Fedora 38: 3.0.9 (`openssl11` provides OpenSSL 1.1 as well)

RHEL/CentOS 7 reaches EOL mid 2024, so for PHP 8.4 scheduled towards the end of this year, we can safely
bump the minimum OpenSSL version.

[^1]: https://www.openssl.org/blog/blog/2023/03/28/1.1.1-EOL/index.html
[^2]: https://packages.debian.org/buster/libssl-dev
[^3]: https://packages.ubuntu.com/focal/libssl-dev
2024-03-23 15:12:06 +00:00
haszi
6150bf5ee4
Fix url_rewriter.hosts not used for output_add_rewrite_var()
If fixes issue where session.trans_sid_hosts used instead of
url_rewriter.hosts for output_add_rewrite_var().

Closes GH-13294
2024-03-22 13:57:43 +00:00
tekimen
4d51bfa270
[RFC] Add mb_ucfirst and mb_lcfirst functions (#13161) 2024-03-20 17:25:19 +01:00
Arnaud Le Blanc
df7252624f [ci skip] NEWS 2024-03-19 13:06:29 +01:00
David Carlier
4c467e6eb8 ext/sockets: adding few constants for NetBSD.
SOCK_CONN_DGRAM (and its alias SOCK_DCCP) for connection orientated
datagram.

Close GH-13728
2024-03-17 21:44:22 +00:00
Máté Kocsis
330cc5cdb2
Deprecate implicit nullable parameter types (#12959)
RFC: https://wiki.php.net/rfc/deprecate-implicitly-nullable-types

Co-authored-by: Gina Peter Banyard <girgias@php.net>
2024-03-13 21:40:26 +01:00
David Carlier
b3410360cc ext/gettext: updating apis accepting domain behavior.
to be more in line with the proper usage ; normally domain should not
be empty strings.

Close GH-13691
2024-03-13 20:33:47 +00:00
Ayesh Karunaratne
47949101ae
ext/sodium: Add new AEGIS constants to UPGRADING file (#13673)
Follow-up to #12867
[ci skip]
2024-03-11 22:16:22 +01:00
Niels Dossche
a47849deaf
Change return type of hash_update() to true (#13652)
It was already the case that this could only return true, update the
stubs to reflect that.

Closes GH-13614.
2024-03-09 20:02:50 +01:00
Niels Dossche
14b6c981c3
[RFC] Add a way to opt-in ext/dom spec compliance (#13031)
RFC: https://wiki.php.net/rfc/opt_in_dom_spec_compliance
2024-03-09 16:56:00 +01:00
Niels Dossche
d6d3370034
Implement GH-13609: Dump wrapped object in WeakReference class (#13621)
I chose "object" as that's also the argument name in WeakReference::create.
2024-03-08 18:31:24 +01:00
Niels Dossche
3ddd341329 [ci skip] NEWS and UPGRADING
Closes GH-13466.
2024-03-07 20:27:19 +01:00
Marc Bennewitz
dbd976a67f
Singular DateTime::[get|set]Microsecond & no tentative return type (#13486)
* Singular DateTime::[get|set]Microsecond & no tentative return type

* Added missing getMicrosecond to DateTimeInterface
2024-03-06 09:18:22 +00:00
Niels Dossche
74c887b04e [ci skip] NEWS and UPGRADING 2024-03-05 20:54:56 +01:00
Ayesh Karunaratne
7b23470666
ext/pcre: Add "/r" modifier (#13583)
Adds support for "Caseless restricted" matching added in PCRE2lib
10.43 with the "r" modifier.

This is `PCRE2_EXTRA_CASELESS_RESTRICT` in PCRE2. This is an "extra"
option, which means it is not possible to pass this option as
pcre2_compile() function parameter.

This option is passed in a pcre2_set_compile_extra_options() call.
Previously, these extra options are set at php_pcre_init_pcre2(),
but after this change, it is possible to customize the options
by adding bits to `eoptions` in pcre_get_compiled_regex_cache_ex().

The tests for this change are ported from upstream test suite[^1].

[^1]: https://github.com/PCRE2Project/pcre2/commit/c13d54f6581#diff-8c8312e4eb2d35bb16485404b7b5cc0eaef0bca1aa95ff5febf6a1890048305c
2024-03-05 20:51:04 +01:00
Ayesh Karunaratne
353d4ce075
ext/xmlreader: Add class constant types to stub (#13596)
Declares class constant types for the `XMLReader` class.
2024-03-05 20:50:54 +01:00
David Carlier
7f01871915 ext/gettext: bind_textdomain_codeset should not accept empty domains.
the man page specifies that for bind_textdomain_codeset, like
bindtextdomain, the domain should not be an empty string.

close GH-13571
2024-03-02 18:59:18 +00:00
Ayesh Karunaratne
1b380d6ad5
UPGRADING: Minor adjustments moving items to appropriate sections (#13576)
- Moved curl_version()['feature_list'] to New Features
- Moved NumberFormatter::ROUND_HALFODD to New Features
- Removed contributor names (this pattern only used in the `NEWS` file)
- Removed "Fixed setAttribute and getAttribute" as it is covered in another change record
2024-03-02 19:34:03 +01:00
Gina Peter Banyard
47a199c8b4
Add http_(get|clear)_last_reponse_headers() functions (#12500)
This is to provide an alternative to the $http_response_header magic variable

RFC: https://wiki.php.net/rfc/http-last-response-headers
2024-02-29 16:41:09 +00:00
Gina Peter Banyard
dbf0b6aa42
ext/intl: Refactor ResourceBundle get and dimension access (#13503) 2024-02-26 17:03:17 +00:00
Niels Dossche
035a5fdf8c
Add LIBXML_RECOVER (#13504)
Setting the recovery option by using a hardcoded value (1) worked
already for SimpleXML. For DOM, a small change is necessary because
otherwise the recover field overwrites the recovery option.

From a quick search on GitHub [1] it looks like this won't clash with
existing PHP code as no one seems to define (or use) a constant with
such a name.

[1] https://github.com/search?q=LIBXML_RECOVER+language%3APHP&type=code&l=PHP
2024-02-25 21:03:37 +01:00
Máté Kocsis
7266e4fc6d
Add forgotten UPGRADING note for doc comment handling related changes
[skip-ci]
2024-02-25 16:02:09 +01:00
Niels Dossche
85217a044a Mark DOMXPath as uncloneable
This never resulted in a working XPath object anyway, as trying to query
or evaluate anything resulted in an "Invalid XPath context" error.
Supporting this is more trouble than it's worth, so just block the clone
operation.
2024-02-23 19:35:38 +01:00
Niels Dossche
205c8b642c [ci skip] NEWS and UPGRADING for DOMXPath::quote()
See commit 2f9320c00f.
2024-02-22 20:32:33 +01:00
Saki Takamachi
d29951891a
NEWS / UPGRADING 2024-02-23 01:12:34 +09:00
David CARLIER
9a3a4b5ba2
ext/intl: IntlDateFormatter class removing redundant error message info. (#13465)
Also correcting new IntlChar class constants typos.
2024-02-21 23:23:09 +00:00
David Carlier
8bc34dd1bf [ci skip] NEWS/UPGRADING 2024-02-21 16:24:27 +00:00
Ayesh Karunaratne
ba0f9fb501
ext/curl: Add feature_info assoc array to curl_version() (#13439)
The `phpinfo()` section of the Curl extension lists individual features
supported by the particular ext-Curl + libcurl build. However, the
`curl_version()` function return values do not indicate the same level of
details.

`curl_version()` has a `protocols` key that returns an array of all protocols
supported by the build. But the `features` key is a bitmask of all the features.
Checking the availability of certain feature requires knowing the corresponding
`CURL_VERSION` constant, and checking the availability of the constant and a
bitmask check for it in the `features` value.

For example, to determine HTTP2 support, it requires evaluating:

```php
defined('CURL_VERSION_HTTP2') && (curl_version()['features'] & CURL_VERSION_HTTP2 === CURL_VERSION_HTTP2)
```

To make feature availability checks more intuitive, this adds a new
`feature_list` key to `curl_version()` output array.

With it, checking for individual features availability is easier, and does
not require inspecting the availability of the `CURL_VERSION` constant and
the `features` key.

```php
!empty(curl_version()['feature_list']['HTTP2']);
```
2024-02-21 00:46:22 +00:00
Niels Dossche
ae5beff61b
Upgrade bundled pcre2lib to 10.43 (#13413) 2024-02-17 14:15:04 +01:00
Jorg Adam Sowa
492b9e09e9
Add entry on return type of long2ip to NEWS (#13408)
[skip ci] add entry on return type of long2ip to NEWS and to UPGRADING.
2024-02-16 17:31:21 +00:00
Steve Wall
f6016c702f ext/ldap: Add LDAP_OPT_X_TLS_PROTOCOL_MAX and LDAP_OPT_X_TLS_PROTOCOL_TLS1_3
close GH-13405.
2024-02-15 21:43:46 +00:00
haszi
3ce7bf2a77
Clear handler status flag in handler init
Closes GH-13087
2024-02-09 12:00:56 +00:00
Ilija Tovilo
cd66fcc68b
Add request_parse_body() function
RFC: https://wiki.php.net/rfc/rfc1867-non-post

This function allows populating the $_POST and $_FILES globals for non-post
requests. This avoids manual parsing of RFC1867 requests.

Fixes #55815
Closes GH-11472
2024-02-08 12:08:07 +01:00
Marc Bennewitz
0016b3085c
Added DateTime[Immutable]::[get|set]Microseconds (#12557)
* Added DateTime[Immutable]::[get|set]Microseconds
2024-02-05 12:14:18 +00:00
Niels Dossche
05874d4c23 [ci skip] Make UPGRADING bullet points consistent 2024-02-04 23:02:58 +01:00
Niels Dossche
3b5986db69 Implement GH-12908: Show attribute name/class in ReflectionAttribute dump
This is consistent with how many other Reflection classes have a name
field, and it makes debugging easier.

Closes GH-12908.
Closes GH-12917.
2024-02-04 23:02:02 +01:00
Saki Takamachi
78970ef6b2
Fix GH-12143: Optimize round
Fixed an error in the result due to "pre-rounding" of the round function.

"Pre-rounding" has been abolished and the method of comparing numbers has
been changed.

Closes GH-12268.
2024-02-03 22:23:02 +09:00
Ayesh Karunaratne
edb9f65f16
ext/curl: Bump minimum Curl version to >= 7.61.0 (#13259)
Bumps the minimum required libcurl version to 7.61.0.

Please also see #4917, which bumped minimum libcurl version to the current >= 7.29.0.
This bumps the minimum requirement to Curl 7.61.0 (released 2018 Sept).

Ubuntu, Debian, RHEL, and RHEL derivatives have major and LTS version bumps this year. Following are the
libcurl-dev/libcurl-devel versions available in the oldest supported (LTS or otherwise) in major OSs.

 - Debian buster: [7.64](https://packages.debian.org/buster/libcurl4-openssl-dev)
 - Ubuntu 20.04: [7.68](https://packages.ubuntu.com/focal/libcurl-dev)
 - CentOS/RHEL 7: 7.29
 - RHEL 8/Rocky 8/EL 8: 7.61
 - Fedora 38: 7.87

RHEL/CentOS 7 reaches EOL mid 2024, so for PHP 8.4 scheduled towards the end of this year, we can safely
bump the minimum libcurl version.

7.61.0 was selected as the new minimum because RHEL and derivatives have libcurl-devel version 7.61. RHEL 8 is
a current and supported RHEL version.
2024-01-31 13:48:17 +00:00
Derick Rethans
987417e2e0
Remove ext/imap — it has been moved to PECL (#13190)
* Remove ext/imap — it has been moved to PECL

https://pecl.php.net/package/imap

* Remove files related to IMAP

* Remove IMAP CI files and set up

* Also disable IMAP on Circle CI

* Update CREDITS file

* Remove IMAP entry from CODEOWNERS

* Revert "Remove files related to IMAP"

This reverts commit a05ffd6c97.

* Mark IMAP is being removed

* Revert "Remove IMAP CI files and set up"

This reverts commit 82e5ba9910.

* Revert "Also disable IMAP on Circle CI"

This reverts commit e83827b0b2.

* Don't try to build imap extension with CI

* Restore test setup files

* Remove mention of imap in labeler, EXTENSIONS, and sample php.ini files
2024-01-22 12:56:05 +00:00
Vincent JARDIN
98e2948ca7 ext/openssl: Add X509 purpose constants.
- X509_PURPOSE_OCSP_HELPER.
- X509_PURPOSE_TIMESTAMP_SIGN.
- Also X509_PURPOSE_ANY is ok since 1.0.1+

Close GH-13149
2024-01-19 07:06:51 +00:00
Niels Dossche
4bd63568fb
Fix argument type of simplexml_import_dom (#13170)
It needs to be "object".
This is because first- and third-party extension can register custom
node types using `php_libxml_register_export`. So we don't know upfront
what types can be expected.

This also changes the error to a TypeError everywhere.
2024-01-18 20:28:01 +01:00
Ayesh Karunaratne
8cc472d5d0 ext/intl: Add NumberFormatter::ROUND_HALFODD
The NumberFormatter::ROUND_HALFEVEN constant exists in PHP already, but its counterpart ROUND_HALFODD was missing.
This adds it, using `UNUM_ROUND_HALF_ODD`

Close GH-13191
2024-01-18 18:12:44 +00:00
Niels Dossche
dcd2a0dde6
Make return type of trigger_error() and user_error() true (#13169) 2024-01-17 17:15:55 +01:00
Peter Kokot
d5dae8bdf1
[skip ci] Update upgrading docs for build related changes (#13176)
This updates the UPGRADING documents with current build system changes
done since the PHP-8.3 release.
2024-01-17 11:21:08 +00:00
Gina Peter Banyard
f7b498b02e
Use true as return types for SplHeap (#13147) 2024-01-15 10:09:38 +00:00
Daniil Gentili
c16ad918ba
Change default method of disabling JIT
https://wiki.php.net/rfc/jit_config_defaults
Closes GH-12678
2024-01-15 09:39:13 +01:00
Niels Dossche
90785dd865
[RFC] Improve callbacks in ext/dom and ext/xsl (#12627) 2024-01-13 00:00:26 +01:00
Tim Düsterhus
e31bf3ad4d
UPGRADING: Add new PHP_ROUND_* to global constants section
see 94ddc74c9a
see #12056
2024-01-12 17:53:03 +01:00
Max Semenik
a2b2830f9b
ext/standard: make debug_zval_dump() output whether the array is packed (#12641) 2024-01-12 00:33:14 +00:00
Máté Kocsis
d6a0b3af68
Implement PDO driver-specific subclasses
RFC: https://wiki.php.net/rfc/pdo_driver_specific_subclasses
Closes GH-12804

Co-Authored-By: Danack <Danack@basereality.com>
2024-01-11 23:22:41 +01:00
hanshenrik
fc16285538 ext/curl: deprecate CURLOPT_BINARYTRANSFER
This is long overdue, CURLOPT_BINARYTRANSFER has been a no-op since PHP5.1.2 in 2004 (ref https://bugs.php.net/bug.php?id=55635 )

Close GH-13114.
2024-01-10 18:16:52 +00:00
Ilija Tovilo
d7d0d19d32
Support index.php fallback for files in built-in server
If no router script is used, the built-in webserver will now look for a fallback
index file recursively in all cases, including URLs with a period.

Fixes GH-12604
Closes GH-12992
2024-01-09 16:13:39 +01:00
haszi
90800b62bb
Change PHP_ZTS and PHP_DEBUG to bool to match their ZEND equivalents (#13079)
Co-authored-by: haszi <haszika80@gmail.com>
2024-01-07 13:38:26 +00:00
Jakub Zelenka
e0679f3d5e
Introduce new serial_hex parameter to openssl_csr_sign
Co-authored-by: Florian Sowade <f.sowade@suora.com>

Closes GH-13023
Closes GH-9851
2024-01-05 14:40:22 +00:00
Máté Kocsis
0b7cd1423a
Add upgrading note about PHP_OUTPUT_HANDLER_PROCESSED
[skip-ci]
2024-01-04 16:05:49 +01:00
David Carlier
b02f95adae ext/sockets: adding windows SO_EXCLUSIVEADDRUSE constant.
Close GH-13030
2023-12-28 15:38:58 +00:00
Jakub Zelenka
48ebe588cd
Implement request #48520: openssl_csr_new should allow multiple values/fields in dn
Closes GH-12984
2023-12-21 16:56:59 +00:00
Jakub Zelenka
e8fde6bd92
Fix bug #80269: OpenSSL sets Subject wrong with extraattribs parameter
Closes GH-12979
2023-12-21 16:51:13 +00:00
Jorg Adam Sowa
94ddc74c9a
RFC: Add 4 new rounding modes to round() function (#12056)
https://wiki.php.net/rfc/new_rounding_modes_to_round_function

Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
2023-12-21 13:28:05 +01:00
Saki Takamachi
5dfb2d95ea
[pdo_firebird] Added pdo_firebird_check_liveness handler (#12757) 2023-12-20 15:37:39 +00:00
Marc Bennewitz
5d85378893 [ci skip] Added UPGRADING entry for GH-12413
Closes GH-12964.
2023-12-17 11:56:29 +01:00
Niels Dossche
d8268f1aba
Change return type of registerNodeClass to true (#12960) 2023-12-16 19:06:56 +01:00
Alex Dowad
fea895bb49 Merge branch 'PHP-8.3'
* PHP-8.3:
  Character indices used by mb_strpos and mb_substr have same meaning, even on invalid strings
2023-12-10 15:04:14 +02:00
Niels Dossche
b34b4d54c3 Fix #44383: PHP DateTime not converted to xsd:datetime
Closes GH-12437.
Closes GH-11725.
2023-12-08 17:26:52 +01:00
Saki Takamachi
834cb64403
Feature: ext/pdo_firebird: Add transaction isolation level and mode settings (#12815)
* Added transaction isolation level and access mode

* Raise a ValueError if an invalid value is passed to PDO::FB_TRANSACTION_ISOLATION_LEVEL.
2023-12-07 17:34:55 +00:00
Gina Peter Banyard
88ba9dc61b
ext/mbstring: Always throw ValueErrors for invalid mb_http_input() type 2023-12-07 17:23:01 +00:00
Frank Denis
1816403d84
[sodium] Add AEGIS-128L and AEGIS-256 (#12867)
Also don't prevent usage of AES-GCM on aarch64, it's been supported since libsodium 1.0.18.

Fixes #12312
2023-12-07 01:31:42 +01:00
Gina Peter Banyard
e74bf42c81
ext/mbstring: Check conversion map only has integers 2023-12-06 23:47:00 +00:00
David Carlier
683e787860 Fix GH-12727: NumberFormatter constructor throws an exception on invalid locale.
Also re-establishing exception throwing on IntlDateFormatter constructor
overwritten by accident most likely so postponing it for next major
release.

Close GH-12868
2023-12-06 06:00:11 +00:00
Niels Dossche
9c306470fb
Handle libxml2 OOM more consistently (#11927)
This is a continuation of commit c2a58ab07d, in which several OOM error
handling was converted to throwing an INVALID_STATE_ERR DOMException.
Some places were missed and they still returned false without an
exception, or threw a PHP_ERR DOMException.
Convert all of these to INVALID_STATE_ERR DOMExceptions. This also
reduces confusion of users going through documentation [1].

Unfortunately, not all node creations are checked for a NULL pointer.
Some places therefore will not do anything if an OOM occurs (well,
except crash).
On the one hand it's nice to handle these OOM cases.
On the other hand, this adds some complexity and it's very unlikely to
happen in the real world. But then again, "unlikely" situations have
caused trouble before. Ideally all cases should be checked.

[1] https://github.com/php/doc-en/issues/1741
2023-12-04 23:49:25 +01:00
Máté Kocsis
2d057757c4 Deprecate calling stream_context_set_option() with 2 arguments 2023-12-04 22:35:30 +01:00
Máté Kocsis
b36eac94d2 Deprecate calling session_set_save_handler() with more than 2 arguments 2023-12-04 22:35:30 +01:00
Máté Kocsis
688c6f373c Deprecate calling ReflectionMethod::__construct() with 1 argument 2023-12-04 22:27:59 +01:00
Máté Kocsis
beaf1e814a Deprecate calling pg_fetch_result(), pg_field_prtlen(), and pg_field_is_null() with 2 arguments 2023-12-04 22:27:59 +01:00
Máté Kocsis
682c2366be Deprecate calling ldap_exop() with more than 4 arguments 2023-12-04 22:27:59 +01:00
Máté Kocsis
1d41eb3014 Deprecate calling ldap_connect() with more than 2 arguments 2023-12-04 22:27:59 +01:00
Máté Kocsis
811245d2e0 Calling IntlGregorianCalendar::__construct() with more than 2 arguments and intlgregcal_create_instance() 2023-12-04 22:27:59 +01:00
Máté Kocsis
f4df37af3d Deprecate calling IntlCalendar::set() with more than 2 arguments and intlcal_set() 2023-12-04 22:27:59 +01:00
Máté Kocsis
adc26424aa Deprecate calling DatePeriod::__construct() with less than 3 arguments 2023-12-04 22:27:59 +01:00
Saki Takamachi
866aa12bcd
ext/pdo: Fixed PDO::setAttribute() and PDO::getAttribute() (#12793) 2023-12-04 16:05:30 +00:00
Niels Dossche
6edbbc1c3e Implement GH-12385: flush headers without body when calling flush()
Closes GH-12785.
2023-12-01 17:15:57 +01:00
Daniil Gentili
fde41bc713
Report fatal error if JIT cannot be enabled
Closes GH-12403
2023-11-28 00:21:26 +01:00
Niels Dossche
fd3a8656ed [ci skip] UPGRADING 2023-11-24 13:37:08 +01:00
Niels Dossche
d3c2673754 [ci skip] NEWS and UPGRADING for mb_*trim 2023-11-24 11:47:32 +01:00
Jakub Zelenka
1e66e6ae73
Revert incomplete PG pipeline addition
Closes GH-12735
2023-11-20 16:22:29 +00:00
Niels Dossche
7658220599
Improve performance of mbfl_name2encoding() by using perfect hashing (#12707)
mbfl_name2encoding() uses a linear loop through the encodings, comparing
the name one by one, which is very slow. For the benchmark [1] just
looking up the name takes about 50% of run-time.

By using perfect hashing instead, we no longer have to loop over the
list, and the number of string comparisons is reduced to just a single
one. The perfect hashing table is generated using GNU gperf and amended
manually to fit in with mbstring and manually changed to  reduce the
cache size.

[1] https://github.com/php/php-src/issues/12684#issuecomment-1813799924
2023-11-17 19:38:43 +01:00
Jakub Zelenka
0f349d4c24
Add POSIX_SC_CHILD_MAX and POSIX_SC_CLK_TCK constants
Closes GH-12689
2023-11-17 11:09:30 +00:00
Gina Peter Banyard
1bdb0fddc1
Refactor pcntl_sigprocmask()/pcntl_sigwaitinfo()/pcntl_sigtimedwait() (#11860) 2023-11-16 00:40:18 +00:00