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

142712 Commits

Author SHA1 Message Date
Alexandre Daubois
c1fa560ba9 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-19577: avoid integer overflow when using a small offset and PHP_INT_MAX with LimitIterator (#19585)
2025-09-05 08:10:48 +02:00
Alexandre Daubois
7cceda1597 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19577: avoid integer overflow when using a small offset and PHP_INT_MAX with LimitIterator (#19585)
2025-09-05 08:10:22 +02:00
Alexandre Daubois
05133ac962 Fix GH-19577: avoid integer overflow when using a small offset and PHP_INT_MAX with LimitIterator (#19585) 2025-09-05 08:09:06 +02:00
Daniel Scherzer
c34558d125 GH-19691: Add asymmetric visibility to Reflection::getModifierNames() (#19697) 2025-09-04 23:00:36 -07:00
Máté Kocsis
01ae278c47 Update uriparser to version 0.9.9 (#19711) 2025-09-04 23:58:08 +02:00
Gina Peter Banyard
a13dc047ac Update NEWS and UPGRADING with entry for null as array offset 2025-09-04 23:19:01 +02:00
Niels Dossche
d0630e850b Avoid double conversion to string in php_userstreamop_readdir()
The string is converted twice for some reason.
This is pointless, and furthermore, this is observable in userspace code
when dealing with Stringable objects.

Closes GH-19713.
2025-09-04 23:14:22 +02:00
Niels Dossche
7e513a5101 Merge branch 'PHP-8.4'
* PHP-8.4:
  Remove incorrect call to zval_ptr_dtor() in user_wrapper_metadata()
2025-09-04 23:13:50 +02:00
Niels Dossche
ad129c6f97 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Remove incorrect call to zval_ptr_dtor() in user_wrapper_metadata()
2025-09-04 23:13:45 +02:00
Niels Dossche
d10ff9bbd8 Remove incorrect call to zval_ptr_dtor() in user_wrapper_metadata()
This one is not initialized. This is not hittable from userspace code
because all locations within first-party php-src code have a valid
`option` argument.

Closes GH-19714.
2025-09-04 23:13:20 +02:00
Alexandre Daubois
49e3956b70 core: Deprecate using null as an array offset and when calling array_key_exists() (#19511)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_using_values_null_as_an_array_offset_and_when_calling_array_key_exists
2025-09-04 22:12:24 +01:00
Tim Düsterhus
ff72fb81ed uri: Stop accessing a private header to retrieve the uriparser version (#19678) 2025-09-04 22:35:42 +02:00
Niels Dossche
4b99519eaa Fix GH-14506: Closing a userspace stream inside a userspace handler causes heap corruption
Use the PHP_STREAM_FLAG_NO_FCLOSE flag to prevent closing a stream while
a handler is running. We already do this in some other places as well.
Only handlers that do something with the stream afterwards need changes.

Closes GH-18797.
2025-09-04 22:05:20 +02:00
Tim Düsterhus
066553c454 fpm: Improve the error message when FPM is running as root (#19695)
* fpm: Improve the error message when FPM is running as root

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

* fpm: Disable `TEST_FPM_RUN_AS_ROOT` for proc-user-not-set-when-root.phpt

---------

Co-authored-by: Jakub Zelenka <bukka@php.net>
2025-09-04 18:58:59 +02:00
Alexandre Daubois
1c664e1c74 Remove mentions of PHP 9.0 2025-09-04 11:48:55 +02:00
Arnaud Le Blanc
d246584ae7 Merge branch 'PHP-8.4'
* PHP-8.4:
  Ensure that type widening converges
2025-09-04 09:15:03 +02:00
Arnaud Le Blanc
d68fd7390d Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Ensure that type widening converges
2025-09-04 09:14:31 +02:00
Arnaud Le Blanc
bd88a54934 Ensure that type widening converges
Range analysis may fail to converge (the process hangs) when the transfer
function zend_inference_calc_range produces a smaller range.

Fix by ensuring that the widening operator zend_inference_widening_meet
allows only widening. This matches the inference rules in figure 13 of the
paper.

Fixes GH-19679
Closes GH-19683
2025-09-04 08:58:06 +02:00
Niels Dossche
a88a5ecbef Fix disabling of InfiniteIterator in fuzzer (#19690)
The canonical way to do this is via `get_constructor` as `create_object`
may not return NULL.
2025-09-04 06:01:58 +02:00
Daniel Scherzer
3f3a266a2b gen_stub: Infer constants' types from values (#19568)
Don't require `@var` with a type when the type can be inferred from a literal
value in the stub file.
2025-09-03 18:26:43 -07:00
Niels Dossche
9b960713c6 [ci skip] Fix test title 2025-09-03 23:00:09 +02:00
Niels Dossche
1847d9188c Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-19612: Mitigate libxml2 tree dictionary bug
2025-09-03 21:58:21 +02:00
Niels Dossche
3023b29a11 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19612: Mitigate libxml2 tree dictionary bug
2025-09-03 21:58:16 +02:00
Niels Dossche
080fd14458 Fix GH-19612: Mitigate libxml2 tree dictionary bug
This code is very similar to code on PHP 8.4 and higher, but the
mitigation is extended to entity references and to attribute children.

Closes GH-19620.
2025-09-03 21:52:48 +02:00
Ilija Tovilo
f8e9e94a23 Merge branch 'PHP-8.4'
* PHP-8.4:
  Stale array iterator pointer
2025-09-03 18:15:59 +02:00
Ilija Tovilo
e4c94829a2 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Stale array iterator pointer
2025-09-03 18:15:35 +02:00
Ilija Tovilo
f9ce6d8f3a Stale array iterator pointer
Fixes GH-19613
Closes GH-19616
2025-09-03 18:14:43 +02:00
Ilija Tovilo
d73466a673 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix RC assertion in fpm when php_admin_value setting fails
2025-09-03 14:50:32 +02:00
Ilija Tovilo
6f17c693ef Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix RC assertion in fpm when php_admin_value setting fails
2025-09-03 14:50:15 +02:00
Ilija Tovilo
15beb140e5 Fix RC assertion in fpm when php_admin_value setting fails
The value is temporarily duplicated. While the value is allocated persistently,
it will be freed if the ini value can't be set. This is safe, given the value
has not actually been stored.

Exposed by GH-19619
Closes GH-19671
2025-09-03 14:49:06 +02:00
Arnaud Le Blanc
3625cbb344 Fix ZTS+JIT build on non-glibc/musl/freebsd/macos/win platforms
Fixes GH-19657
Closes GH-19667
2025-09-03 13:50:02 +02:00
Ilija Tovilo
e84393104a Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix date_sunrise() and date_sunset() with partial-hour UTC offset
2025-09-03 13:35:37 +02:00
Ilija Tovilo
73fc2db234 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix date_sunrise() and date_sunset() with partial-hour UTC offset
2025-09-03 13:35:04 +02:00
Ilija Tovilo
0ae9a58ade Fix date_sunrise() and date_sunset() with partial-hour UTC offset
See GH-19633
Closes GH-19672
2025-09-03 13:34:03 +02:00
Ilija Tovilo
8a4cbde8c7 Use ull integer suffix for bitwise logic (GH-19673)
If (brake->type+1) exeeds 30, we have undefined behavior and won't actually
remove the relevant bit.

See GH-19633
2025-09-03 13:29:12 +02:00
Jorg Adam Sowa
1e02099e6a ext/mbstring: Use internal_encoding INI setting instead of mb_internal_encoding() in tests (#19663)
Moves the usage of `mb_internal_encoding()` to INI section for the tests not testing the encoding/function itself, but the other mbstring/iconv functions.
2025-09-03 11:34:12 +01:00
Arnaud Le Blanc
a4afc57f1d Deprecate driver specific PDO methods
RFC: https://wiki.php.net/rfc/deprecations_php_8_5.

Closes GH-19596
2025-09-03 08:42:33 +02:00
Derick Rethans
d85662d6cc Improve accuracy of ext_stmt emits during pipe operations
We need to emit the EXT_STMT opcode before we compile the call, so that we
attach the line number of where the right hand pipe operator starts.

We also do not need to reset the line number anymore.

The following code shows where these EXT_STMTs are introduced.

```
<?php
/* EXT_STMT */ $myString = "<Hello World>";
$result = /* EXT_STMT */ $myString

    |> /* EXT_STMT(!0:$myString) */ \htmlentities(...)

    |>
		/* EXT_STMT($4) */ \str_split(...)

    |> /* EXT_STMT($6) */ (fn($x) => array_map(strtoupper(...), $x))

    |> /* EXT_STMT($9) */ (fn($x) => join( ', ', $x));

/* EXT_STMT */ echo $result, /* EXT_STMT */ "\n";
```
2025-09-02 18:54:58 +01:00
Gina Peter Banyard
326c254c1e sapi/fuzzer: Fix disabling of InfiniteIterator (#19668) 2025-09-02 16:59:30 +01:00
Dmitry Stogov
d25687b15f Merge branch 'PHP-8.4'
* PHP-8.4:
  Cleanup SSA(s) in case of fatal error during tracing JIT
2025-09-02 10:06:51 +03:00
Dmitry Stogov
d59ae9345c Cleanup SSA(s) in case of fatal error during tracing JIT
This fixes segfault becuse of UAF in ext/standard/tests/gh14643_longname.phpt
2025-09-02 10:04:40 +03:00
Dmitry Stogov
7ea5c2b47f Merge branch 'PHP-8.4'
* PHP-8.4:
  Update IR
2025-09-02 10:02:33 +03:00
Dmitry Stogov
93740d0a82 Update IR
IR commit: 3d7ac467fc89c136866f11195355789d9850de9f
2025-09-02 10:01:52 +03:00
Jakub Zelenka
0c6b83887e Merge branch 'PHP-8.4' 2025-09-01 23:07:43 +02:00
Jakub Zelenka
e15ec6a054 Merge branch 'PHP-8.3' into PHP-8.4 2025-09-01 23:07:14 +02:00
Jakub Zelenka
6194084837 Use the default OpenSSL version for MacOS to match libs
This seems like an issue that might be potentially causing issues like
GH-12901. The problem is that libs like libcurl, libldap and others use
the default OpenSSL version so this might result in linking issues.

The fact that OpenSSL 1.1.1 was actually good that we were able to have
it in the pipeline but this is just not right setup so we should find
another way how to test it at least in nightly.

Closes GH-19472
2025-09-01 23:06:39 +02:00
Tim Düsterhus
c93b467b37 zend_ast: Fix Closure scope for FCC in constant expression (#19639)
Fixes php/php-src#19637
2025-09-01 21:20:37 +02:00
benstone
7d5c8dad3b Add support for retrieving Exif from HEIF file
Signed-off-by: Benstone Zhang <benstonezhang@gmail.com>

Closes GH-13443
2025-09-01 20:54:36 +02:00
Arnaud Le Blanc
0ee7732c01 Fix opcache.huge_code_pages
Building opcache into the main executable breaks opcache.huge_code_pages,
as we were relying on the fact that accel_remap_huge_pages() is not in the
same mapping as the main text segment.

Here I ensure that accel_remap_huge_pages() is placed out of the text
segment, and remap only the text segment. This approach is used in [1].

Closes GH-19388.

[1] 676bb7dec3/large_page-c/large_page.c (L260).
2025-09-01 19:36:11 +02:00
Arnaud Le Blanc
95d52d52da Fix JIT stack setup on aarch64/clang
On aarch64 we must set IR_USE_FRAME_POINTER to ensure that LR/x30 is
saved. Also, fixed_stack_frame_size must be n*16, not n*16+8 like on x86.

Fixes GH-19601
Closes GH-19630
2025-09-01 19:16:39 +02:00