Commit Graph

1509 Commits

Author SHA1 Message Date
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