1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Commit Graph

70835 Commits

Author SHA1 Message Date
Daniel Scherzer
0b326dcbab [RFC] FILTER_THROW_ON_FAILURE (#18896)
https://wiki.php.net/rfc/filter_throw_on_failure
2025-08-26 03:16:39 -07:00
Tim Düsterhus
1193823541 uri: Clean up uri_parser_rfc3986.c (#19586)
* uri: Unify string creation in `php_uri_parser_rfc3986_scheme_read()`

* uri: Remove useless non-NULL assertions in uri_parser_rfc3986.c

The value of `uriparser_uri` is dereferenced *immediately* after the assertion,
making it redundant for both the human reader and the compiler. In case of the
normalized_uri, the pointer is trivially non-NULL, since it is referring to a
struct member at not-the-first position.

Generally speaking, unless something is checked for `NULL` one can assume it to
never be `NULL`.

* uri: Add `has_text_range()` helper to uri_parser_rfc3986.c
2025-08-26 09:28:21 +02:00
Arnaud Le Blanc
6f32e1c690 Deprecate driver specific PDO constants
RFC: https://wiki.php.net/rfc/deprecations_php_8_5.

Closes GH-19526
2025-08-26 09:06:19 +02:00
Gina Peter Banyard
8a5972fd83 ext/standard: Deprecate $http_response_header (#19464)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_http_response_header_predefined_variable
2025-08-25 22:43:26 +01:00
Tim Düsterhus
5d5305d99d uri: Properly prefix symbols in uri_parser_*.[ch] (#19554)
* uri: Remove unnecessary forward declaration of `uriparser_free_uri()`

* uri: Properly prefix symbols in uri_parser_rfc3986.[ch]

* uri: Make `#define`s in uri_parser_whatwg proper typed constants

* uri: Properly prefix symbols in uri_parser_whatwg.[ch]

* NEWS
2025-08-25 18:58:00 +02:00
Ilija Tovilo
6497c6c455 Don't substitute self/parent with anonymous class
Fixes GH-18373
Closes GH-19537
2025-08-25 17:08:29 +02:00
Tim Düsterhus
5127a229bf uri: Mark local pointers as const in URI parser implementations (#19581)
* uri: Mark local pointers as `const` in uri_parser_whatwg.c

* uri: Mark local pointers as `const` in uri_parser_rfc3986.c
2025-08-25 15:08:29 +02:00
Daniel Scherzer
7e5ad5caf8 ext/intl: Add #[\Deprecated] to U_MULTIPLE_DECIMAL_SEPERATORS constant (#19564) 2025-08-25 03:08:46 -07:00
Daniel Scherzer
1cbaa60807 ext/reflection: Align return types and values (#19567)
Return `true` or `false` for boolean functions, use `zend_result` for functions
that return `SUCCESS` or `FAILURE`.
2025-08-25 01:52:46 -07:00
Daniel Scherzer
4731245952 ext/session: Add #[\Deprecated] to SID constant (#19566) 2025-08-25 01:52:35 -07:00
Daniel Scherzer
b360cf8c28 ext/hash: Add #[\Deprecated] to MHASH_* constants (#19565) 2025-08-25 01:52:25 -07:00
Niels Dossche
e976926843 Update lexbor to lexbor/lexbor@b46db664 2025-08-24 23:51:35 +02:00
Jorg Adam Sowa
d6d0a2a217 remove safe_mode leftovers (#19552) 2025-08-24 03:55:15 +01:00
Gina Peter Banyard
93716bece4 Enact follow-up phase of the "Path to Saner Increment/Decrement operators" RFC (#19374)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#enact_follow-up_phase_of_the_path_to_saner_incrementdecrement_operators_rfc
2025-08-23 14:36:39 +01:00
Gina Peter Banyard
e27c436607 Merge branch 'PHP-8.4' 2025-08-23 15:28:56 +02:00
Gina Peter Banyard
20c274b688 Merge branch 'PHP-8.3' into PHP-8.4 2025-08-23 15:27:25 +02:00
Gina Peter Banyard
f5a3a642c6 ext/phar: Fix memory leaks when verifying OpenSSL signature (#19563) 2025-08-23 14:25:42 +01:00
Kuba Werłos
94d0b41db1 Fix corrupted result after recursive tokenization during token_get_all()
Fixes GH-19507
Closes GH-19547

Co-authored-by: Arnaud Le Blanc <arnaud.lb@gmail.com>
2025-08-22 18:29:50 +02:00
Arnaud Le Blanc
73b98a3858 TAILCALL VM
Introduce the TAILCALL VM, a more efficient variant of the CALL VM:

 * Each opcode handler tailcalls the next opcode handler directly instead of
   returning to the interpreter loop. This eliminates call and interpreter loop
   overhead.
 * Opcode handlers use the preserve_none calling convention to eliminate
   register saving overhead.
 * preserve_none uses non-volatile registers for its first arguments, so
   execute_data and opline are usually kept in these registers and no code is
   required to forward them to the next handlers.

Generated machine code is similar to a direct-threaded VM with register pinning,
like the HYBRID VM.

JIT+TAILCALL VM also benefits from this compared to JIT+CALL VM:

 * JIT uses the registers of the execute_data and opline args as fixed regs,
   eliminating the need to move them in prologue.
 * Traces exit by tailcalling the next handler. No code is needed to forward
   execute_data and opline.
 * No register saving/restoring in epilogue/prologue.

The TAILCALL VM is used when the HYBRID VM is not supported, and the compiler
supports the musttail and preserve_none attributes: The HYBRID VM is used when
compiling with GCC, the TAILCALL VM when compiling with Clang>=19 on x86_64 or
aarch64, and the CALL VM otherwise.

This makes binaries built with Clang>=19 as fast as binaries built with GCC.
Before, these were considerably slower (by 2.8% to 44% depending on benchmark,
and by 5% to 77% before 76d7c616bb).

Closes GH-17849
Closes GH-18720
2025-08-22 18:05:52 +02:00
Arnaud Le Blanc
c6f02a4ee3 Merge branch 'PHP-8.4'
* PHP-8.4:
  Differenciate WeakMaps from bare HashTables used as weak maps for GC purposes
2025-08-22 16:39:05 +02:00
Arnaud Le Blanc
62e30ecae1 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Differenciate WeakMaps from bare HashTables used as weak maps for GC purposes
2025-08-22 16:33:08 +02:00
Arnaud Le Blanc
d74901ae1a Differenciate WeakMaps from bare HashTables used as weak maps for GC purposes
Since cbf67e4, the GC needs to find all WeakMaps referencing a weakly
referenced object. Doing so, it treats all ZEND_WEAKREF_TAG_MAP as WeakMap
instances.

However, a ZEND_WEAKREF_TAG_MAP reference may be a bare HashTable when
zend_weakrefs_hash_add() is used.

Introduce a new tag, ZEND_WEAKREF_TAG_BARE_HT, and use this tag when weakly
referencing an object from a bare HashTable. Ignore such references in GC.

Fixes GH-19543
Closes GH-19544

Co-authored-by: Tim Düsterhus <tim@tideways-gmbh.com>
2025-08-22 16:32:30 +02:00
Tim Düsterhus
4a1789cc34 uri: Use PHP_RINIT/SHUTDOWN_FUNCTION in uri_parser_whatwg (#19541)
This improves discoverability of this kind of “lifecycle” helper function.
2025-08-21 23:12:45 +02:00
Tim Düsterhus
0cb3f9a3e2 uri: Improve return type of uriparser_parse_uri_ex() (#19540)
This function is not intended to be called via a function pointer, so we don't
need to deal with a generic `void*`.
2025-08-21 23:12:28 +02:00
Ilija Tovilo
6290900338 [skip ci] Fix uri parser test https when openssl is not available 2025-08-21 12:09:30 +02:00
Tim Düsterhus
ae3b81dcfe uri: Fix header guard constant name for uri_parser_*.h (#19539)
Introduced in php/php-src#19530.
2025-08-21 10:23:39 +02:00
Máté Kocsis
e9c92a9739 ext/uri: Use the term "URI parser" instead of "URI handler" (#19530) 2025-08-21 07:23:47 +02:00
Daniel Scherzer
63acc4bf61 [RFC] Add #[\DelayedTargetValidation] attribute (#18817)
https://wiki.php.net/rfc/delayedtargetvalidation_attribute
2025-08-20 00:41:20 -07:00
Máté Kocsis
1cff1815d0 Add internal URI handling API (#19073)
Part of https://github.com/php/php-src/pull/14461. Related to https://wiki.php.net/rfc/url_parsing_api.
2025-08-19 18:35:09 +02:00
Arnaud Le Blanc
504a633780 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fit JIT variable not stored before YIELD
2025-08-19 15:54:46 +02:00
Arnaud Le Blanc
bc05bfe7c5 Fit JIT variable not stored before YIELD
JIT doesn't recognize that variables may be used after returning from a
trace due to YIELD, so some effects may never be stored to memory.

YIELD ops terminate trace recordings with ZEND_JIT_TRACE_STOP_RETURN, and are
handled mostly like RETURN. Here I change zend_jit_trace_execute() so that
YIELD terminates recordings with ZEND_JIT_TRACE_STOP_INTERPRETER instead,
to ensure that we recognize that variables may be used after returning from
the trace due to YIELD.

Fixes GH-19493
Closes GH-19515
2025-08-19 15:49:29 +02:00
Niels Dossche
d92675b6c1 [ci skip] Fix comment after a3de2ce9 2025-08-17 01:33:23 +02:00
David Carlier
1299376b8f Merge branch 'PHP-8.4' 2025-08-16 19:28:11 +01:00
David Carlier
0fc3a2e624 Merge branch 'PHP-8.3' into PHP-8.4 2025-08-16 19:28:00 +01:00
Arjen de Korte
a97717d23e Fix GH-19021: deprecation for tidyOptIsReadOnly
The tidyOptGetCategory function (added in libtidy 5.4.0) if only useable if TidyInternalCategory (added in libtidy 5.6.0) is also present, so check for the latter instead.

close GH-19053
2025-08-16 19:24:47 +01:00
Alexandre Daubois
010fe2bb42 [RFC] Deprecate constant redeclaration (#19474)
https://wiki.php.net/rfc/deprecations_php_8_5
2025-08-16 09:54:37 -07:00
Gina Peter Banyard
1c67b060c4 main: Add bailout tests for dir opening on user stream 2025-08-15 18:41:17 +02:00
Gina Peter Banyard
0992265611 main: refactor userstream method calling
Closes GH-19312
2025-08-15 18:41:17 +02:00
Alexandre Daubois
e5f81bd74c spl: Use size_t to store spl_heap’s count (#19482) 2025-08-15 09:50:49 +02:00
David Carlier
b73d8b373a Merge branch 'PHP-8.4' 2025-08-15 08:08:16 +01:00
David Carlier
fd4db3e178 Merge branch 'PHP-8.3' into PHP-8.4 2025-08-15 08:05:14 +01:00
Mark Karpeles
987a3a5c8e Fix GH-19484 i: potential use after free when using persistent pgsql connections.
By setting the notice processor to a no-op when a persistent connection is cleaned for future use.

Close GH-19485
2025-08-15 08:04:14 +01:00
Niels Dossche
dcd3ef33b3 Realign entries 2025-08-15 08:41:56 +02:00
Niels Dossche
1bba07ecc0 partitioned option for setcookie/setrawcookie and sessions
RFC: https://wiki.php.net/rfc/CHIPS

Closes GH-12646.
Closes GH-12652.
2025-08-15 08:41:24 +02:00
Gina Peter Banyard
cab46b27b9 ext/standard: Deprecate passing integers outside the interval [0, 255] to chr() (#19441)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_integers_outside_the_interval_0_255_to_chr
2025-08-14 20:48:48 +01:00
Gina Peter Banyard
fb87b14b6c ext/spl: Deprecate ArrayObject and ArrayIterator with objects (#19420)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_arrayobject_and_arrayiterator_with_objects

This also moves tests into a subfolder.
2025-08-14 12:38:57 +01:00
Ilija Tovilo
9c754baa99 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix "Constant already defined" warning with repeated inclusion of file with __halt_compiler()
2025-08-14 12:16:16 +02:00
Ilija Tovilo
708d8e9cfd Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix "Constant already defined" warning with repeated inclusion of file with __halt_compiler()
2025-08-14 12:15:00 +02:00
Ilija Tovilo
a3de2ce9ba Fix "Constant already defined" warning with repeated inclusion of file with __halt_compiler()
Fixes GH-18850
Closes GH-19471
2025-08-14 12:13:50 +02:00
Dmitry Stogov
222f7517a1 Merge branch 'PHP-8.4'
* PHP-8.4:
  Added test for PR #19458
2025-08-13 15:59:57 +03:00