1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 17:22:15 +01:00
Commit Graph

142975 Commits

Author SHA1 Message Date
Daniel Scherzer
da775b8332 Update versions for PHP 8.5.0RC1 php-8.5.0RC1 2025-09-23 16:19:29 -04:00
Daniel Scherzer
ea580760f0 Prepare for PHP 8.5.0RC1 2025-09-23 15:11:52 -04:00
Calvin Buckley
a9b69b1b3d Fix Uri\WhatWg\Url::withHost() (#19935)
Fixes GH-19913, fixes GH-19918, fixes GH-19920

Cherry-picked from lexbor/lexbor#a766eec632b69a8c3c1987aeb3910d51f110f8dc

Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
2025-09-23 11:44:07 -07:00
Ilija Tovilo
decf77f2fb Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] Skip php_cli_server_pdeathsig.phpt if pgrep is missing
2025-09-23 17:15:17 +02:00
Ilija Tovilo
7bce6d89e7 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Skip php_cli_server_pdeathsig.phpt if pgrep is missing
2025-09-23 17:15:09 +02:00
Ilija Tovilo
c6a6cb79f9 [skip ci] Skip php_cli_server_pdeathsig.phpt if pgrep is missing
Fixes GH-19911
Closes GH-19923
2025-09-23 17:14:51 +02:00
Ilija Tovilo
8b51bcaa18 Fix CGI with auto_globals_jit=0
In CGI, php_auto_globals_create_server() (i.e. auto_global_callback() here)
initializes $_ENV to reuse for $_SERVER. However, because $_SERVER is
constructed first, we have not yet initialized auto_global->armed of the $_ENV
global. Split the loop into initialization and constructor phases.

Closes GH-19870
2025-09-23 16:53:11 +02:00
Ilija Tovilo
7a63dcc3ca Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix more curl 8.16 issues
2025-09-23 16:42:31 +02:00
Ilija Tovilo
473ce44108 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix more curl 8.16 issues
2025-09-23 16:22:06 +02:00
Ilija Tovilo
a885372a08 Fix more curl 8.16 issues
The CURLOPT_FOLLOWLOCATION seems like a gcc bug, where the integer extension of
bool to long is lost, but I was unable to reproduce on godbolt.org.
2025-09-23 16:11:19 +02:00
James Titcumb
d9ca72f891 Add composer.json.in to ext/skeleton for PIE support (#19853)
* Add composer.json.in to ext/skeleton for PIE support

* Add --vendor param to ext_skel.php to provide vendor name for PIE packages
2025-09-23 14:57:33 +02:00
Jakub Zelenka
dcc4b0ff07 Fix build when --with-openssl-legacy-provider set
It was missing proper backend init split.

Closes GH-19930
2025-09-23 12:26:04 +02:00
Gina Peter Banyard
320fe2975b core: Warn when coercing NAN to other types
RFC: https://wiki.php.net/rfc/warnings-php-8-5#coercing_nan_to_other_types

Closes GH-19573
2025-09-23 11:16:51 +01:00
Gina Peter Banyard
d27e1e1723 core: Add new test for coercions from NAN 2025-09-23 11:14:58 +01:00
Ilija Tovilo
f389aded6a Warn on http_response_code() after header('HTTP/...')
Fixes GH-18582
Fixes #81451
Closes GH-18962

Co-authored-by: Jakub Zelenka <bukka@php.net>
2025-09-23 11:45:47 +02:00
Tim Düsterhus
e23c6222da uri: Clean up naming of remaining public symbols (#19917)
* uri: Rename `uri_object_t` to `php_uri_object`

* uri: Rename `uri_(read|write)_component_*` to `php_uri_property_(read|write)_*_helper`

* uri: Rename `URI_SERIALIZED_PROPERTY_NAME` to `PHP_URI_SERIALIZE_URI_FIELD_NAME`

* uri: Rename `uri_internal_t` to `php_uri_internal`

* uri: Use proper `php_uri_ce_` prefix for all CEs

* uri: Make the object handlers `static` and remove them from the header
2025-09-23 09:19:56 +02:00
Ilija Tovilo
6e1b1900f0 Mark enums and static fake closures as not collectable
Closes GH-19866
2025-09-22 23:27:33 +02:00
sasezaki
78c997f36f Make ReflectionConstant non-final
Fixes GH-19747
Closes GH-19901
2025-09-22 19:52:59 +02:00
Dmitry Stogov
83ccc97d80 Merge branch 'PHP-8.4'
* PHP-8.4:
  Update IR
2025-09-22 20:14:49 +03:00
Dmitry Stogov
1302b9f6da Update IR
IR commit: 425ca45ffed99b6d3085c6a7f7c9d4fb3c2b5737
2025-09-22 20:14:21 +03:00
Dmitry Stogov
58981ade34 Merge branch 'PHP-8.4'
* PHP-8.4:
  Update IR
2025-09-22 19:31:41 +03:00
Dmitry Stogov
ef202cc4b7 Update IR
IR commit: 503018483d8333a3cfb25ab89a1eadefbee665bc
2025-09-22 19:31:06 +03:00
Arnaud Le Blanc
f0878c8e30 Merge branch 'PHP-8.4'
* PHP-8.4:
  Handle references after FETCH_OBJ_R with REG destination
2025-09-22 17:57:35 +02:00
Arnaud Le Blanc
32c919b474 Handle references after FETCH_OBJ_R with REG destination
zend_jit_fetch_obj_r_slow_ex() may be used by the function JIT, which doesn't
rely on guards to handle references. Therefore it must deref the property value.

Other variants of zend_jit_fetch_obj_*_slow_ex can not be used used in function
JIT.

Fixes GH-19831
Closes GH-19838
2025-09-22 17:56:57 +02:00
Ilija Tovilo
1aafd3e4eb Fix bzopen() stream mode validation
The previous conditions were unreadable and incorrect. Extract the primary mode
first, then compare it to the allowed values.

Fixes GH-19810
Closes GH-19815
2025-09-22 15:43:47 +02:00
Tim Düsterhus
707f78528c uri: Inline parser and uri into uri_object_t (#19906)
* uri: Inline `uri_internal_from_obj()` and `Z_URI_INTERNAL_P()`

Changes performed with Coccinelle with some minor adjustments in places where
it choked due to macros:

    @@
    expression e;
    @@

    - Z_URI_INTERNAL_P(e)
    + &Z_URI_OBJECT_P(e)->internal

    @@
    expression e;
    @@

    - uri_internal_from_obj(e)
    + &uri_object_from_obj(e)->internal

* uri: Inline definition of `URI_ASSERT_INITIALIZATION()`

While a `NULL` pointer to `zend_object` would result in `->internal` also
sitting at `0`, this is not a particularly useful assertion to have. Instead
just assert that we have a parsed `->uri` available.

Changes made with Coccinelle + some manual adjustments:

    @@
    uri_internal_t *u;
    expression e;
    @@

     u = &Z_URI_OBJECT_P(e)->internal
    ... when != u
    - URI_ASSERT_INITIALIZATION(u);
    + ZEND_ASSERT(u->uri != NULL);

    @@
    uri_internal_t *u;
    expression e;
    @@

     u = &uri_object_from_obj(e)->internal
    ... when != u
    - URI_ASSERT_INITIALIZATION(u);
    + ZEND_ASSERT(u->uri != NULL);

* uri: Inline `parser` and `uri` into `uri_object_t`

After this, `uri_internal_t` will only be used when interacting with the URI
parsers without having a full-blown URI object.

Changes made with Coccinelle and some manual adjustments:

    @@
    identifier u;
    expression e;
    @@

    - uri_internal_t *u = &e->internal;
    + uri_object_t *u = e;

    @@
    uri_object_t *u;
    identifier t;
    @@

    - u->internal.t
    + u->t

* uri: Fix outdated `internal` naming for `uri_object_t`

* uri: Clean up naming of `uri_object_t` variables
2025-09-22 11:46:14 +02:00
Ilija Tovilo
c79d8b6449 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix curl 8.16.0 compilation with zts
2025-09-22 10:56:51 +02:00
Ilija Tovilo
74cacdd161 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix curl 8.16.0 compilation with zts
2025-09-22 10:56:40 +02:00
Ilija Tovilo
266cb7d892 Fix curl 8.16.0 compilation with zts 2025-09-22 10:55:59 +02:00
Alexandre Daubois
e6c07b004b Fix GH-14402: Add support for serialization in SplPriorityQueue, SplMinHeap and SplMaxHeap (#19447) 2025-09-22 09:43:09 +02:00
Gina Peter Banyard
4bc060c0f3 Update NEWS and UPGRADING for __wakeup() deprecation of date classes 2025-09-22 00:10:19 +01:00
Gina Peter Banyard
4fbd2480bf ext/date: Deprecate __wakeup() methods in favour of __unserialize() (#19827)
The __wakeup() method is obsolete as a __unserialize() magic method is implemented.
Therefore, any class extending from those classes that overload deserialization should call the __unserialize() method instead of __wakeup() to properly handle the deserialization.

This deprecation follows the wording of the deprecation of the SplFixedArray::__wakeup() magic method.
2025-09-22 00:06:30 +01:00
Gina Peter Banyard
2a19375dd0 Update NEWS and UPGRADING for OOB floats to int casts 2025-09-21 23:56:27 +01:00
Gina Peter Banyard
b4ed215299 core: Warn when non-representable floats are coerced to int (#19760)
RFC: https://wiki.php.net/rfc/warnings-php-8-5#casting_out_of_range_floats_to_int
2025-09-21 23:53:16 +01:00
Tim Düsterhus
5f00673a45 uri: Fix handling of large port numbers in URI struct (#19905)
* uri: Fix handling of large port numbers in URI struct

* uri: Explain the choice of type for `php_uri.port`

* NEWS
2025-09-21 23:19:54 +02:00
Tim Düsterhus
c7485a0b8f uri: Fix const-correctness violation in uri_*_from_obj (#19907)
The functions derived non-const pointers from a const-pointer, which is not
correct. Since php/php-src#19854 no `const` pointers are passed into these
functions, so we can just make the parameter non-const.
2025-09-21 22:23:51 +02:00
Tim Düsterhus
d58ecb5d3d uri: Clean up logic in uri_unserialize() (#19903)
* uri: Check early whether we would be overwriting an existing URI in `uri_unserialize()`

* uri: Access the CE consistently in `uri_unserialize()`
2025-09-21 22:23:33 +02:00
Ilija Tovilo
5897071ab6 Fix refcounting on zend_empty_array in ext-uri (GH-19908)
Fixes GH-19892
2025-09-21 21:56:04 +02:00
Jacob Adams
9fe6fb2566 ext/iconv: Build fix for illumos distributions and solaris
close GH-18933
2025-09-21 20:13:12 +01:00
Niels Dossche
1f6ac30769 Allow empty statements before declare(strict_types)
Fixes GH-19719
Closes GH-19859
2025-09-21 19:36:59 +02:00
David Carlier
5c6f25bd64 Merge branch 'PHP-8.4' 2025-09-21 14:26:02 +01:00
David Carlier
ea822513b3 Merge branch 'PHP-8.3' into PHP-8.4 2025-09-21 14:25:52 +01:00
David Carlier
933e087843 Fix GH-19885: dba_fetch() overflow on skip argument.
close GH-19887
2025-09-21 14:23:53 +01:00
Marc Bennewitz
3b6d83aa9c ext/standard: set[raw]cookie: No format call needed for constant expires (#19900) 2025-09-21 12:25:24 +01:00
Tim Düsterhus
cb49281739 uri: Pass uri_object_t instead of zend_object where possible (#19854)
* uri: Take `uri_object_t` in `uri_get_debug_properties()`

* uri: Take `uri_object_t` as `base_url_object` in `php_uri_instantiate_uri()`

* uri: Take `uri_object_t` as `that_object` in `uri_equals()`

* uri: Take `this_object` a `uri_object_t` in `uri_equals()`

* uri: Take `uri_object_t` in `throw_cannot_recompose_uri_to_string()`
2025-09-20 10:43:42 +02:00
Jakub Zelenka
2b637dfc4e Rename php_uri_parser free to destroy (#19888)
This is to fix Windows debug build when it is macro for _free_dbg
2025-09-19 20:12:35 +02:00
Bob Weinand
0bb146fae0 Make the call VM read the opline back after interrupts (#19890)
This happened implicitly in the past due to EX(opline) being used - or in the hybrid VM case, the implicit LOAD_OPLINE() happening as part of ZEND_VM_ENTER().

With 76d7c616bb opline is used standalone and the return value of zend_interrupt_helper_SPEC ignored. Make use of it...

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2025-09-19 19:44:56 +02:00
Arnaud Le Blanc
41538c9ff4 NEWS 2025-09-19 19:02:49 +02:00
Arnaud Le Blanc
ef9a89f7ec Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-19480: error_log php.ini cannot be unset when open_basedir is configured
2025-09-19 18:13:55 +02:00
Arnaud Le Blanc
938226083e Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19480: error_log php.ini cannot be unset when open_basedir is configured
2025-09-19 14:16:48 +02:00