Commit Graph

1768 Commits

Author SHA1 Message Date
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
Niels Dossche
1492be5286
[RFC] DOM HTML5 parsing and serialization support (#12111) 2023-11-13 20:18:19 +01:00
Jakub Zelenka
3b68df24bd
Add note to UPGRADING about proc_open changes for invalid command
Closes GH-12589
2023-11-12 18:17:10 +00:00
Niels Dossche
f150f99752
Improve browscap get_browser performance (#12651)
* Split function and use _new variant to avoid redundant checks

* Precompute better array size to avoid rehashing

* Use new function to add into array instead of merging into, preventing temporary memory allocations

* Convert to regex without separate copy + lowering

We're already doing a character-wise loop after lowering, so just lower
it character by character instead of looping over it twice and
allocating memory.

* Use HASH_MAP loop because htab can never be packed

This saves additional checks.

* Move destructor to more sensible place

* Remove now unused browscap_zval_copy_ctor

* Use zend_string_release_ex variant where possible

* Implement dedicated greedy wildcard matching algorithm

This avoids compiling, allocating and caching regexes and should run in
the same complexity.

* Cache previous length instead of repeatedly recomputing it

* Add additional optimization to wildcard * matching

* Move cheap checks to the callsite

The function prologue and epilogue have a stupidly high overhead for
those 2 simple checks at the start.

We can't always-inline the reg_compare function because it contains
alloca, and the alloca is really important for performance.
Instead, move those cheap checks to the call site.

* Use specialised loop to avoid unnecessary conversions and checks

* Optimize counting loop by taking into account the prefix

* Precompute the hash values of known keys

* [ci skip] UPGRADING

* Code style

* Add a note why we have the early-skip checks in the loop
2023-11-11 18:44:17 +01:00
Dmitriy Degtyaryov
63898008c0 Fix GH-9344: pgsql pipeline mode proposal.
Adding pg_send_flush_request.
Fix freeze after next execute pg_send_* on PQgetResult in _php_pgsql_link_has_results.
Set nonblocking for pipelining mode.
No flush client buffer in pg_send_* for pipelining mode.

Close GH-12644
2023-11-10 16:06:04 +00:00
Niels Dossche
1ad5f9da36 [ci skip] UPGRADING 2023-11-04 15:20:49 +01:00
Niels Dossche
9a973a3743
Optimize strcspn (#12594) 2023-11-04 13:54:30 +00:00
David Carlier
ee5fe483c2 [ci skip] fix typo in UPGRADING 2023-11-02 18:47:43 +00:00
David Carlier
d4183c2c91 [ci skip] Intl extension UPGRADING note 2023-11-01 19:15:12 +00:00
Niels Dossche
a470c4aeef Fix GH-12532: PharData created from zip has incorrect timestamp
The datetime stored in the DOS time fields, which is what zip standard
uses, is local time without a timezone. There's an extension to the zip
file format since '97 that allows storing a unix timestamp (in UTC) in
the header for both the central directory and the local entries.
This patch adds support for this.

Closes GH-12548.
2023-10-29 17:20:44 +01:00
Jorg Adam Sowa
74ba9167c8
Typed constants in sqlite extension (#12379) 2023-10-29 10:53:07 +01:00
Jorg Adam Sowa
9ad7844160
Typed constants in Intl extenstion (#12360) 2023-10-29 10:50:16 +01:00
Jorg Adam Sowa
dff8679af8
Typed constants in PDO extension (#12362) 2023-10-29 10:43:19 +01:00
Alex Dowad
d04854b38c Add fast mb_strcut implementation for UTF-16
Similar to the fast, specialized mb_strcut implementation for UTF-8
in 1f0cf133db, this new implementation of mb_strcut for UTF-16 strings
just examines a few bytes before each cut point.

Even for short strings, the new implementation is around 2x faster.
For strings around 10,000 bytes in length, it comes out about 100-500x
faster in my microbenchmarks.

The new implementation behaves identically to the old one on valid
UTF-16 strings; a fuzzer was used to help verify this.
2023-10-28 19:09:08 +02:00
Jorg Adam Sowa
e8d8a5fe69
Typed constants in reflection extension (#12378) 2023-10-28 09:47:19 +02:00
Viktor Vassilyev
e58af7c160 ext/soap: Add support for clark notation for namespaces in class map
Closes GH-12411.
2023-10-23 23:39:28 +02:00
Niels Dossche
98b08c52db
Implement request #68325: parse huge option for xml_parser_create (#12256) 2023-10-22 16:44:49 +02:00
George Peter Banyard
0e5d654409
ext/xml: Refactor extension to use FCC instead of zvals for handlers (#12340)
To get proper errors and sensible behaviour, as the current behaviour is somewhat insane and part of it should be axed ASAP.

The behaviour is mostly intact with some minor BC breaks which are mentioned in UPGRADING.

Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2023-10-20 13:14:55 +01:00
SakiTakamachi
b5c287e4b4 Fix GH-12423: Changed to prioritize DSN authentication information over arguments.
Added connection test

Close GH-12424
2023-10-15 20:24:30 +01:00
Niels Dossche
d0b29d8286 Optimize strspn()
The current implementation uses a nested loop (for + goto), which has
complexity O(|s1| * |s2|). If we instead use a lookup table, the
complexity drops to O(|s1| + |s2|).
This is conceptually the same strategy that common C library
implementations such as glibc and musl use.
The variation with a bitvector instead of a table also gives a speed-up,
but the table variation was about 1.34x faster.

On microbenchmarks this easily gave a 5x speedup.

This can bring a 1.4-1.5% performance improvement in the Symfony
benchmark.

Closes GH-12431.
2023-10-14 21:24:55 +02:00
David Carlier
57a8f63f7f [ci skip] UPGRADING pgsql update 2023-10-08 18:26:02 +01:00
Niels Dossche
009d48da1c
Convert bounds exception in SplFixedArray to OutOfBoundsException instead of RuntimeException (#12383) 2023-10-08 18:57:57 +02:00
Jorg Adam Sowa
f0757100a4
Typed constants in SPL extension (#12358) 2023-10-07 13:14:57 +01:00
Niels Dossche
3bb56ae418
Add missing properties to xsl stub (#12334)
* Define doXInclude for XSLTProcessor, and test the property

This was added in 8d1427dd98, but never defined on the stub.
It was more or less fine when dynamic properties were not deprecated,
but now they throw a deprecation warning. To fix it, define on the stub.
This should also help discoverability of the functionality.

* Define cloneDocument for XSLTProcessor, and test the property

This was introduced in 5c039bbad9, but never defined on the stub.
It was more or less fine when dynamic properties were not deprecated,
but now they throw a deprecation warning. To fix it, define on the stub.
This should also help discoverability of the functionality.
2023-10-06 17:42:47 +02:00
Tim Düsterhus
42a85fc5d9
password_hash: Increase PHP_PASSWORD_BCRYPT_COST to 12 (#12367)
RFC: https://wiki.php.net/rfc/bcrypt_cost_2023
2023-10-06 14:27:01 +02:00
Niels Dossche
5c749ad4cf Implement request #64137 (XSLTProcessor::setParameter() should allow both quotes to be used)
This reimplements the parameter handling. Instead of quoting the strings
manually, adding them to an array, and passing that as input; use the
libxslt API to pass data verbatim to the processor.
This also simplifies the code a lot.

Closes GH-12331.
2023-09-30 21:41:06 +02:00
Niels Dossche
3e29332a5c Merge branch 'PHP-8.3'
* PHP-8.3:
  Apply SimpleXML iterator fixes only on master
2023-09-30 18:02:59 +02:00
Niels Dossche
5d68d61943 Implement #53655: Improve speed of DOMNode::C14N() on large XML documents
The XPath query is in accordance to spec [1]. However, we can do it in a
simpler way. We can use a custom callback function instead of a linear
search in XPath to check if a node is visible. Note that comment nodes
are handled internally by libxml2 already, so we do not need to
differentiate between node types. The callback will do an upwards
traversal of the tree until the root of the canonicalization is reached.
In practice this will speed up the application a lot.

[1] https://www.w3.org/TR/2001/REC-xml-c14n-20010315 section 2.1

Closes GH-12278.
2023-09-23 20:56:16 +02:00
Niels Dossche
ce6e58cf63 [ci skip] Move things to the right section in UPGRADING 2023-09-22 23:55:23 +02:00
Tim Düsterhus
659c06d4c9
UPGRADING: Move the validation of the rounding mode to Backward Incompatible Changes 2023-09-22 17:35:03 +02:00
Tim Düsterhus
3d857d5b81
round(): Validate the rounding mode (#12252) 2023-09-22 17:32:09 +02:00
David Carlier
f6fae19a10 ext/intl: expose dateformat UDAT_PATTERN constant.
Close GH-12258
2023-09-22 12:32:22 +01:00
Tim Düsterhus
9652889b43
Reimplement php_round_helper() using modf() (#12220)
This change makes the implementation much easier to understand, by explicitly
handling the various cases.

It fixes rounding for `0.49999999999999994`, because no loss of precision
happens by adding / subtracing `0.5` before turning the result into an integral
float. Instead the fractional parts are explicitly compared.

see GH-12143 (this fixes one of the reported cases)
Closes GH-12159 which was an alternative attempt to fix the rounding issue for
`0.49999999999999994`
2023-09-19 18:05:05 +02:00
Niels Dossche
880faa39e8
Add DOMNode::compareDocumentPosition() (#12146)
Reference: https://dom.spec.whatwg.org/#dom-node-comparedocumentposition
2023-09-09 01:14:26 +02:00
Niels Dossche
4ad5388b00 [ci skip] UPGRADING 2023-09-06 18:01:02 +02:00
Pierrick Charron
ad2ac6f05f
Prepare for PHP 8.4 2023-08-29 15:25:46 -04:00
Niels Dossche
0b9702c9ed Implement GH-11934: Allow to pass CData into struct and/or union fields
Co-authored-by: KapitanOczywisty <44417092+KapitanOczywisty@users.noreply.github.com>

Closes GH-11935.
2023-08-29 17:01:10 +02:00
Niels Dossche
1754794fc3 [ci skip] Fix typos in UPGRADING 2023-08-28 23:00:05 +02:00
Jakub Zelenka
766cac072f
Fix bug #76857: Can read "non-existant" files
This change makes checked and opened file consistent in a way that it is
using real path for stat operation in the same way like it is used for
open.

Closes GH-12067
2023-08-28 16:53:28 +01:00
Jakub Zelenka
ba9650d697
Fix bug #52335 (fseek() on memory stream behavior different then file)
This changes memory stream to allow seeking past end which makes it the
same as seeking on files. It means the position is allowed to be higher
than the string length. The size only increases if data is appended to
the past position. The space between the previous string and position
is filled with zero bytes.

Fixes GH-9441
Closes GH-12058
2023-08-28 13:32:34 +01:00
Jakub Zelenka
10e16347ef
Format UPGRADING 2023-08-28 11:40:03 +01:00
Jakub Zelenka
aff46d75e1
Fix GH-11982: str_getcsv returns null byte for unterminated quoted string
Closes GH-12047
2023-08-28 11:28:34 +01:00
Marcus Bointon
d7eb4cfdb2
[ci skip] Add note about ReflectionProperty::setValue() signature deprecation to upgrade guide (#12036) 2023-08-24 23:18:19 +01:00
HypeMC
f25474f7f2
Add before_needle argument to strrchr()
Closes GH-11430
2023-08-24 14:26:46 +01:00
David CARLIER
9eb032bdcb
[ci skip] Adding missing SO_ATTACH_REUSEPORT_CBPF tangential constants (#12042) 2023-08-24 13:52:56 +01:00
Máté Kocsis
462792ee51 Expose PDO_ODBC_TYPE to userland 2023-08-23 21:20:41 +02:00
Ayesh Karunaratne
1887f02b0b
Add class constant types to Phar extension (#11826) 2023-08-21 07:14:45 +02:00
Ayesh Karunaratne
543eedf9e1
[skip-ci] minor typo fixes in UPGRADING and CONTRIBUTING.md (#11976) 2023-08-16 07:51:56 +02:00
Niels Dossche
d46dc5694c Fix various namespace prefix conflict resolution bugs and namespace shift bugs
There are two linked issues:

- Conflicts couldn't be resolved by changing the prefix name.
- Lacking a prefix would shift the namespace as the default namespace,
  causing elements to suddenly become part of the namespace instead of
  the attributes.

The output could still be improved by removing redundant namespace
declarations, but that's another issue. At least the output is
correct now.

Closes GH-11777.
2023-08-15 20:42:42 +02:00
Kamil Tekiela
0b887042ae
mysqli_field_seek return type changed to true (#11948) 2023-08-14 19:04:34 +01:00
Kamil Tekiela
f907a009f9
Align highlight_string|file with HTML standard and modern browsers
Closes GH-11913
2023-08-12 15:08:28 +01:00
Niels Dossche
23ba4cde53 Align DOMChildNode parent checks with spec
Closes GH-11905.
2023-08-09 21:24:33 +02:00
Máté Kocsis
038b2ae254
Make the $enable parameter of odbc_autocommit() nullable (#11909)
Co-authored-by: George Peter Banyard <girgias@php.net>
2023-08-08 15:31:58 +02:00
Niels Dossche
e701b2fee7 Make DOMChildNode::remove() run in O(1) performance
This method had some useless logic in it. It checked whether the child
node is a child of its parent, which is always true of course.
But I know where this check comes from, if you follow the spec closely
you'll find that the spec used to have explicit child and parent
arguments for the removal algorithm [1].
That's because that algorithm is written in a generic way, where the
parent and child arguments might not come from the same subtree.
However, in this particular case it *is* always the case that the child
is a child of its parent. The checks weren't needed back then for
DOMChildNode::remove(), and are still not needed today.

[1] e.g. https://web.archive.org/web/20180601092634/https://dom.spec.whatwg.org/#concept-node-remove
2023-08-07 17:32:46 +02:00
George Peter Banyard
aecedd25dd
[skip ci] Reorder extension sections in UPGRADING 2023-08-04 18:24:53 +01:00
Arne_
8ef0e4cfa0
Allow easter_date to process years after 2037 on 64bit systems (#11862)
Added a check to easter_date to allow it to run with years past
2037 when on a 64bit platform.
2023-08-04 16:47:04 +01:00
Mikhail Galanin
958a25e22e
Add "revalidate" time to opcache scripts list
Closes GH-11816
2023-08-03 10:01:39 +02:00
Ilija Tovilo
b2dbf0a2c6
Remove opcache.consistency_checks
This feature has been broken at least since the tracing JIT and inheritance
cache have been introduced. The attempted fix (GH-10798) was too complex. We
have thus decided to remove this feature for now.

Closes GH-11832
2023-08-02 19:22:30 +02:00
Juliette
04c820fd16
[ci skip] PHP 8.3 Upgrading: fix assert_options() typo + minor grammar tweaks (#11845)
Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2023-08-01 15:54:09 +01:00
Juliette
e0bee2cc8a
[ci skip] PHP 8.3 Upgrading: move two entries to the right section (#11846)
These were both listed under "Backward Incompatible Changes", while, as far as I can see, these are "New Features".

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2023-08-01 15:22:29 +01:00
jrfnl
78bfe682a5 [ci skip] PHP 8.3 Upgrading:
add missing PGSQL functions/constants

Follow up on 10868, which introduced these functions and constants.

add missing PGSQL visibility constants

Follow up on 10935, which introduced these constants.

Close GH-11838
2023-07-31 17:08:25 +01:00
jrfnl
a8fa0b54d8 [ci skip] PHP 8.3 Upgrading: fix pg_set_error_context_visibility typo
Ref: 21aaf3321f

Close GH-11837
2023-07-31 17:07:20 +01:00
jrfnl
c7cbe3764a [ci skip] PHP 8.3 Upgrading: add missing POSIX constants
Follow up on 10238 which added these constants.

Close GH-11835
2023-07-31 17:07:04 +01:00
Niels Dossche
ae66a0d142 Corrections to return type of loading DOM documents 2023-07-29 14:58:01 +02:00
Remi Collet
0893b4bed5
add ZipArchive::LENGTH_TO_END and ZipArchive::LENGTH_UNCHECKED constants 2023-07-28 15:56:31 +02:00
George Peter Banyard
722b5cc986
[skip ci] Update UPGRADING with all relevant information 2023-07-18 13:07:01 +01:00
Máté Kocsis
0f64b01aee
Add UPGRADING note about SNMP class constant type declarations
[skip-ci]
2023-07-18 13:55:01 +02:00
Niels Dossche
de60872cfd
Add new curl constants from curl until (including) 7.87 (#10459)
Fixes GH-10454
2023-07-17 20:42:39 +02:00
Niels Dossche
db5e8ae6cf Implement DOMElement::toggleAttribute()
ref: https://dom.spec.whatwg.org/#dom-element-toggleattribute

Closes GH-11696.
2023-07-17 20:06:49 +02:00
Niels Dossche
a73f38f407
Implement DOMElement::insertAdjacent{Element,Text} (#11700)
* Implement DOMElement::insertAdjacent{Element,Text}

ref: https://dom.spec.whatwg.org/#dom-element-insertadjacentelement
ref: https://dom.spec.whatwg.org/#dom-element-insertadjacenttext

Closes GH-11700.
2023-07-17 17:42:47 +02:00
George Peter Banyard
d8696f9216
[RFC] Path to Saner Increment/Decrement operators (#10358)
* Add behavioural tests for incdec operators

* Add support to ++/-- for objects castable to _IS_NUMBER

* Add str_increment() function

* Add str_decrement() function

RFC: https://wiki.php.net/rfc/saner-inc-dec-operators

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
Co-authored-by: Arnaud Le Blanc <arnaud.lb@gmail.com>
2023-07-17 15:51:24 +01:00
Niels Dossche
2f318cfb06 Implement DOMNode::isEqualNode()
Since we still support obsoleted nodes in our implementation, this uses
the old spec to match the old nodes; and this uses the new spec for
nodes still defined in the living spec.
When unclear, the behaviour was cross-verified with Firefox.

References:
https://dom.spec.whatwg.org/#dom-node-isequalnode (for everything still in the living spec)
https://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/DOM3-Core.html#core-Node3-isEqualNode (for old nodes removed from the living spec)

Closes GH-11690.
2023-07-17 15:29:36 +02:00
Niels Dossche
d04f48b6ac Implement DOMNode::parentElement and DOMNameSpaceNode::parentElement
ref: https://dom.spec.whatwg.org/#parent-element

Closes GH-11679.
2023-07-17 13:15:31 +02:00
Niels Dossche
d38cc9b9b6 Implement DOMNode::isConnected and DOMNameSpaceNode::isConnected
ref: https://dom.spec.whatwg.org/#dom-node-isconnected

Closes GH-11677.
2023-07-17 13:14:13 +02:00
Arnaud Le Blanc
e413419e33 [ci skip] UPGRADING / NEWS 2023-07-16 13:42:35 +02:00
Arnaud Le Blanc
d0731934b7
Expose time spent collecting cycles in gc_status() (#11523) 2023-07-16 12:34:28 +02:00
Joshua Behrens
08b57772b0
Warn when fpm socket was not registered on the expected path
This might happen if the UDS length limit is exceeded.

Co-authored-by: Jakub Zelenka <bukka@php.net>

Closes GH-11066
2023-07-15 14:21:58 +01:00
Niels Dossche
72e2e25066 Implement DOMElement::id
ref: https://dom.spec.whatwg.org/#dom-element-id

Closes GH-11701.
2023-07-14 14:37:11 +02:00
Niels Dossche
6560c9bf8e Implement DOMParentNode::replaceChildren()
ref: https://dom.spec.whatwg.org/#dom-parentnode-replacechildren
2023-07-14 14:34:29 +02:00
Niels Dossche
b24b3510f9 Implement DOMElement::className
ref: https://dom.spec.whatwg.org/#dom-element-classname

Closes GH-11691.
2023-07-13 19:05:09 +02:00
George Peter Banyard
3d4ff5ae22
RFC: Deprecate remains of string evaluated code assertions (#11671)
Link: https://wiki.php.net/rfc/assert-string-eval-cleanup
2023-07-13 15:45:32 +01:00
Niels Dossche
d17069e191 Implement DOMNode::getRootNode()
ref: https://dom.spec.whatwg.org/#dom-node-getrootnode

Closes GH-11693.
2023-07-13 16:27:28 +02:00
Niels Dossche
10d7e8dc3a Implement DOMElement::getAttributeNames()
ref: https://dom.spec.whatwg.org/#dom-element-getattributenames
2023-07-13 16:18:10 +02:00
Ilija Tovilo
d9db446065
Fix iface const visibility variance check 2023-07-13 10:52:58 +02:00
Niels Dossche
ea794e9cde Implement DOMNode::contains()
ref: https://dom.spec.whatwg.org/#dom-node-contains
2023-07-12 19:29:07 +02:00
Tim Düsterhus
c2cc1dbc85
[ci skip] NEWS / UPGRADING for ldap_connect with 2 arguments deprecation
see 69a8b63ecf
2023-07-11 17:34:38 +02:00
Tim Düsterhus
b3553159a7
[ci skip] Fix UPGRADING section for the mt_srand() default
This is an existing function and thus belongs into section 5, not section 6.
2023-07-10 19:10:41 +02:00
Marc Bennewitz
e85fb0902c
number_format() Support rounding negative places
Closes GH-11487
2023-07-09 14:05:32 +01:00
Arnaud Le Blanc
627a7e4f49 [ci skip] UPGRADING
See GH-9104
2023-07-08 22:52:58 +02:00
Niels Dossche
49864198cc [ci skip] NEWS and UPGRADING
Closes GH-11577.
2023-07-07 18:08:20 +02:00
Tim Düsterhus
61251093ab
Deprecate MT_RAND_PHP (#11560)
see https://wiki.php.net/rfc/deprecations_php_8_3#mt_rand_php
2023-07-07 12:16:48 +02:00
Tim Düsterhus
3d0cb90a1d
[ci skip] Fix ordering in deprecation sections in UPGRADING 2023-07-07 12:14:39 +02:00
Niels Dossche
f16b34f1d0 Implement GH-10024: support linting multiple files at once using php -l
This is supported in both the CLI and CGI modes. For CLI this required
little changes.

For CGI, the tricky part was that the options parsing happens inside the
loop. This means that options passed after the -l flag were previously
simply ignored. As we now re-enter the loop we would parse the options
again, and if they are handled but don't set the script name, then CGI
will think you want to read from standard in. To keep the same "don't
parse options" behaviour I simply wrapped the options handling inside an
if.

Closes GH-10024.
Closes GH-10710.
2023-07-05 15:20:36 +02:00
Niels Dossche
c585c0c0d4 [ci skip] NEWS and UPGRADING 2023-07-03 21:34:52 +02:00
BohwaZ
ddd9a08f56
[RFC] Transition SQLite3 to exceptions (#11058)
* Deprecate warnings in SQLite3, change returned exception class to SQLite3Exception

RFC: https://wiki.php.net/rfc/sqlite3_exceptions

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
2023-07-03 14:30:52 +01:00
Tim Düsterhus
49ef6e209d
RFC: Add #[Override] attribute (#9836)
* Add #[Override] attribute

* Move #[\Override] tests into Zend/tests/attributes/override/

* Check `check_only` before removing `ZEND_ACC_OVERRIDE`

* NEWS/UPGRADING for #[\Override]
2023-06-29 20:23:53 +02:00
Remi Collet
b406f7c67a
zip extension version 1.22.1
- add ZipArchive::FL_OPEN_FILE_NOW to open the file when added
  instead of waiting for archive to be closed
2023-06-29 15:21:15 +02:00
Remi Collet
a2f75eb56c
[ci skip] ZipArchive::FL_RECOMPRESS constant is deprecated (doc) 2023-06-28 14:44:33 +02:00
Niels Dossche
f37884215c [ci skip] UPGRADING 2023-06-27 18:04:11 +02:00
Remi Collet
ddb6cadb4c
NEWS and UPGRADING for zip 1.22.0 2023-06-26 16:43:59 +02:00
hanshenrik
3b0e61956e
fix file() flags error-check
the old flag check was flawed and would miss some flags, for example:
file(__FILE__, FILE_APPEND);
is invalid, but the old flags error check would miss it: https://3v4l.org/b2W9u

Closes GH-11483
2023-06-23 11:06:24 +02:00
Remi Collet
21aaf3321f
check PQsetErrorContextVisibility availability (libpq >= 9.6) 2023-06-21 08:47:59 +02:00
Niels Dossche
68591632b2
[RFC] Implement mb_str_pad() (#11284)
Closes GH-10203.
2023-06-20 21:22:04 +02:00
nielsdos
ad5ee8a2b7 Revert changes to DOMAttr::$value and DOMAttr::$nodeValue expansion
Closes GH-11469.
2023-06-19 19:52:28 +02:00
George Peter Banyard
798c40a739
[RFC] Define proper semantics for range() function (#10826)
RFC: https://wiki.php.net/rfc/proper-range-semantics
2023-06-19 14:25:26 +01:00
David CARLIER
b0d8c10fd9 ext/gd: imagerotate removes ignore_transparent argument.
seems to be a relic of PHP 5 but no longer makes sense in regard of gdImageRotateInterpolated.

Close GH-11426
2023-06-19 12:32:08 +01:00
Ilija Tovilo
b3e33be443
Forward shutdown exceptions to user error handlers
Fixes GH-10695
Closes GH-110905
2023-06-15 17:11:22 +02:00
David CARLIER
dd8514a0bd ext/pgsql: adding pg_set_error_context_visibility.
another level of context for pg_last_error/pg_result_error() to include
or not the context in those. PQSHOW_CONTEXT_ERRORS being the default.

Close GH-11395
2023-06-13 18:07:39 +01:00
Niels Dossche
d22d0e26dc Implement GH-8641: STREAM_NOTIFY_COMPLETED over HTTP never emitted
This adds support for the completed event. Since the read handler could
be entered twice towards the end of the stream we remember what the eof
flag was before reading so we can emit the completed event when the flag
changes to true.

Closes GH-10505.
2023-06-10 19:47:36 +02:00
Niels Dossche
79d024ac0e
Allow final modifier when using a method from a trait (#11394)
Fixes GH-11388.

Following https://wiki.php.net/rfc/horizontalreuse which introduced traits,
this should be allowed.
The implementation was refactored in 3f8c729. That commit is the first time
the "final" check appears AFAICT, but no reason was given for why. That
commit seems to have landed in 5.4.11 and the NEWS for that version doesn't
seem to mention something relevant to the behaviour change.
This patch removes the restriction of the final modifier.

Closes GH-11394.
2023-06-07 23:53:21 +02:00
Tim Starling
0cc028c374 Changelog notes for DOMAttr value and nodeValue properties 2023-06-05 20:12:28 +02:00
Niels Dossche
61e1f8aaeb Let closure created from magic method accept named parameters
Implements GH-11348.

Closes GH-11364.
2023-06-05 20:03:09 +02:00
David CARLIER
16a63d7b07 ext/pgsql: php_pgsql_convert converts E_NOTICE to TypeError/ValueError exceptions.
Close GH-11238
2023-06-05 15:31:39 +01:00
Ilija Tovilo
0b1d750d91
Allow arbitrary expressions in static variable initializer
Closes GH-9301
2023-05-24 20:17:31 +02:00
Daniel Kesselberg
fa10dfcc81
Add PKCS7_NOOLDMIMETYPE and OPENSSL_CMS_OLDMIMETYPE
PKCS7_NOOLDMIMETYPE to use Content-Type application/pkcs7-mime
OPENSSL_CMS_OLDMIMETYPE to use Content-Type application/x-pkcs7-mime

SMIME_write_PKCS7 and SMIME_write_CMS are using SMIME_write_ASN1_ex.
The Content-Type application/x-pkcs7-mime is generated with the flag SMIME_OLDMIME (0x400).[^1]

SMIME_write_PKCS7 set SMIME_OLDMIME by default.[^2]
SMIME_write_CMS does not.[^3]

I picked OPENSSL_CMS_OLDMIMETYPE over OPENSSL_CMS_NOOLDMIMETYPE because that's what the flag actually does.

[^1]: 9a2f78e14a/crypto/asn1/asn_mime.c (L248-L251)
[^2]: 9a2f78e14a/crypto/pkcs7/pk7_mime.c (L41-L43)
[^3]: 9a2f78e14a/crypto/cms/cms_io.c (L93)

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2023-05-06 11:12:31 +01:00
David CARLIER
f31d253849 ext/pgsql adding PGSQL_ERRORS_SQLSTATE constant support.
Close GH-11181
2023-05-05 15:08:27 +01:00
Cédric Anne
c02348cf9d
Make SERVER_SOFTWARE compliant with RFC3875 (#11093) 2023-05-05 12:43:34 +01:00
David Carlier
7ec8ae12c4 ext/pgsql: pg_trace allow to refine its trace mode via 2 new constants.
- PGSQL_TRACE_SUPPRESS_TIMESTAMPS.
- PGSQL_TRACE_REGRESS_MODE to have a more verbose and observable
output to check possible regressions.

Close GH-11041
2023-05-05 11:05:03 +01:00
ColinHDev
e2f477c2cb
Fix negative indices on empty array not affecting next chosen index
Changed the value of nNextFreeElement in _zend_empty_array from 0 to
ZEND_LONG_MIN.

Fixes GH-11154
Closes GH-11157
2023-05-02 12:05:48 +02:00
Tim Düsterhus
bf727cf5e2
RFC: Make unserialize() emit a warning for trailing bytes (#9630) 2023-05-01 19:06:40 +02:00
David Carlier
bbe42a5ccd [skip ci] UPGRADING highligh last intl deprecation difference 2023-04-29 11:44:33 +01:00
David Carlier
7b4b40f06f ext/sockets: addig Linux's IP_BIND_ADDRESS_NO_PORT.
Delay ephemeral port number attribution at connect time rather
than at bind's one.

Close GH-11119.
2023-04-26 19:26:29 +01:00
David CARLIER
976d7ed4c6 ext/intl: deprecate U_MULTIPLE_DECIMAL_SEPERATORS constant
Close GH-10980
2023-04-23 10:37:55 +01:00
Máté Kocsis
414f71a902
Typed class constants (#10444)
RFC: https://wiki.php.net/rfc/typed_class_constants

Co-Authored-By: Ben <7127204+moliata@users.noreply.github.com>
Co-Authored-By: Bob Weinand <3154871+bwoebi@users.noreply.github.com>
Co-Authored-By: Ilija Tovilo <ilija.tovilo@me.com>
2023-04-16 22:20:26 +02:00
Alex Dowad
a62d192ede Add additional note on mb_encode_mimeheader in UPGRADING 2023-04-10 19:43:40 +02:00
Alex Dowad
aa51871adc Add more details to NEWS on mb_detect_encoding; also include in UPGRADING 2023-04-10 19:43:05 +02:00
Alex Dowad
d64c7184d4 Remove unneeded occurrences of my name in UPGRADING
In NEWS, each 'news item' is suffixed with the name of the developer
who implemented the change. When adding entries to UPGRADING, I used
the same format as NEWS, without thinking about it much. However, it
has come to my attention that the standard format for entries in
UPGRADING does not include the developer's name.
2023-04-10 19:35:35 +02:00
David CARLIER
6c532df705 ext/sockets adding FreeBSD's SO_REUSEPORT_LB constant.
SO_REUSEPORT_LB is, in fact, closer to the classical Linux's SO_REUSEPORT.

Close GH-11038
2023-04-08 17:35:10 +01:00
Ilija Tovilo
9a250cc9d6
Add separate static property through trait if parent already declares it
Fixes GH-10935
Closes GH-10937
2023-04-06 14:27:24 +02:00
Máté Kocsis
0a169cbd5b
Add forgotten upgrading note for the Readonly amendments RFC 2023-04-03 22:07:36 +02:00
David CARLIER
717f460fa4
ext/posix: posix_eaccess little update and forgotten UPGRADING entry. (#10965) 2023-03-29 20:08:42 +01:00
David CARLIER
2da299703a ext/intl IntlChar::enumCharNames changes the signature to void.
Close GH-10904
2023-03-28 18:07:35 +01:00
David Carlier
7623bf0b06 ext/intl: breakiterator::setText returns false on failure.
Close GH-10820
2023-03-28 13:29:09 +01:00
Ilija Tovilo
61e98bf35e
Disallow parent dir components (..) in open_basedir() at runtime
Fix GH-10469
Closes GH-10913
2023-03-25 18:02:20 +01:00
Alex Dowad
bf64342d30 Update NEWS and UPGRADING to reflect changes in 0ce755be26 2023-03-24 22:00:19 +02:00
David CARLIER
feb82d91b9
pgsql_insert fix unit tests (#10860) 2023-03-15 22:57:25 +00:00
David Carlier
90a39fd52c ext/mysqi: mysqli_poll raises a ValueError on absent 1st and 2ng arguments. 2023-03-15 17:49:31 +00:00
David Carlier
974a3d8441 ext/mysqli/pgsql: mysqli_fetch_object/pgsql_fetch_object raises ValueError on constructor args error.
Closes GH-10832.
2023-03-13 19:54:49 +00:00
Kévin Dunglas
f0495855a3
feat: enable Zend Max Execution Timers by default in 8.3 (#10778) 2023-03-10 16:22:42 +01:00
David Carlier
45677081fa ext/intl: dateformatter settimezone changes on success, returning true like setcalendar.
Closes GH-10790
2023-03-09 21:45:26 +00:00
George Peter Banyard
67b5e6b819
[skip ci] Update UPGRADING for saner array_(sum|product)() RFC 2023-03-07 15:49:00 +00:00
David Carlier
02ec4c5071 Fix GH-10727: Spoofchecker constant updates.
- Adding MIXED_NUMBERS from ICU 58.
- Adding HIDDEN_OVERLAY from ICU 62.

Closes GH-10730.
2023-02-28 12:27:38 +00:00
David CARLIER
fbaa2eb059 ext/sockets: add TCP_REPAIR to silently close a connection.
Closes GH-10724.
2023-02-27 22:56:06 +00:00
othercorey
e1967ca9ed
Change DOMCharacterData::appendData return type to true (#10690) 2023-02-25 21:42:10 +00:00
Alex Dowad
8995f60258 mb_decode_mimeheader obeys RFC 2047 regarding underscores and QPrint encoding 2023-02-22 23:19:57 +02:00
Niels Dossche
25d6c932ef
Fix GH-10239: proc_close after proc_get_status always returns -1
The waitpid function only works once when a process is exited.
Cache the result so subsequent status reads succeed.

Closes GH-10250
2023-02-22 12:05:33 +01:00
Niels Dossche
821fc55a68
Implement GH-9826: Make class_alias() work with internal classes (#10483)
We can't increase the refcount of internal classes during request time.
To work around this problem we simply don't refcount aliases anymore and
add a check in the destruction to skip aliases entirely.
There were also some checks which checked for an alias implicitly by
comparing the refcount, these have been replaced by checking the type of
the zval instead.
2023-02-22 11:47:32 +01:00
George Peter Banyard
1e769bd1bf
[skip ci] Add FFI BC to UPGRADING
Follow-up on commit 851e4623f5
2023-02-20 13:52:30 +00:00
Niels Dossche
e52684ea8a
Fix GH-10377: Unable to have an anonymous readonly class
This fixes the oversight that an anonymous class should be able to be
readonly. Other identifiers such as final and abstract do not make
sense. As we still want nice errors for when users try to use these
modifiers, or use multiple modifiers, we introduce a new function
zend_add_anonymous_class_modifier that will perform verification for
anonymous class modifiers, just like zend_add_class_modifier does for
non-anonymous classes.

Closes GH-10381
2023-02-20 13:32:26 +01:00
Cristian Rodríguez
5e617d0b4d
proc_open: reject array with empty command name (#10559) 2023-02-18 18:48:11 +00:00
David Carlier
19a7281efa sockets add SO_RERROR/SO_ZEROIZE/SO_SPLICE net/openbsd's constants.
Closes GH-10563.
2023-02-12 21:55:55 +00:00
David Carlier
908d954de0 sockets updlite protocol support, with checksum coverage settings.
Close GH-10468
2023-01-29 18:19:54 +00:00
Ilija Tovilo
02bd52b5a8
Implement dynamic class const fetch
https://wiki.php.net/rfc/dynamic_class_constant_fetch

Closes GH-9793
2023-01-26 16:46:34 +01:00
Máté Kocsis
016160800c
Fix GH-10259 ReflectionClass::getStaticProperties doesn't need null return type (#10418) 2023-01-24 22:26:52 +01:00
Tim Düsterhus
c59e0750af
password: Use php_random_bytes_throw in php_password_make_salt (#10393)
The CSPRNG failing should be rare nowadays, but it *might* happen and without
this patch it's hard for the user to find out why the salt generation failed:
The error message is not actionable.

This patch will automatically set the CSPRNG exception to the `$previous`
exception of the ValueError that is thrown, allowing the developer to determine
the cause of the salt generation failure.

Before:

    Fatal error: Uncaught ValueError: Unable to generate salt in php-src/test3.php:3
    Stack trace:
    #0 php-src/test3.php(3): password_hash(Object(SensitiveParameterValue), '2y')
    #1 {main}
      thrown in php-src/test3.php on line 3

After:

    Fatal error: Uncaught Random\RandomException: Cannot open /dev/urandom: No such file or directory in php-src/test3.php:3
    Stack trace:
    #0 php-src/test3.php(3): password_hash(Object(SensitiveParameterValue), '2y')
    #1 {main}

    Next ValueError: Unable to generate salt in php-src/test3.php:3
    Stack trace:
    #0 php-src/test3.php(3): password_hash(Object(SensitiveParameterValue), '2y')
    #1 {main}
      thrown in php-src/test3.php on line 3
2023-01-23 18:35:16 +01:00
David Carlier
b60761ab97 [ci skip] UPGRADING 2023-01-23 12:16:25 +00:00