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

72568 Commits

Author SHA1 Message Date
Weilin Du
da1e89fd3d RFC: Add Form Feed in Trim Functions (#20788)
RFC: https://wiki.php.net/rfc/trim_form_feed

Resolves GH-20783.
2026-03-09 22:28:50 +01:00
ndossche
0155b50984 phar: Fix const-generic compile warnings 2026-03-09 20:45:07 +01:00
Calvin Buckley
d81db0b9de Merge branch 'PHP-8.5'
* PHP-8.5:
  Update NEWS for pcntl fix [skip ci]
  ext/pcntl: Bump num_signals to uint16_t (#21347)
2026-03-09 14:31:32 -03:00
Calvin Buckley
f38058d223 ext/pcntl: Bump num_signals to uint16_t (#21347)
On AIX, NSIG is def'd as SIGMAX64+1, and SIGMAX64 itself is def'd as
255:

```
$ grep -Rw SIGMAX64 /QOpenSys/usr/include/
/QOpenSys/usr/include/sys/signal.h:#define SIGMAX64 255
/QOpenSys/usr/include/sys/signal.h:#define SIGMAX SIGMAX64
/QOpenSys/usr/include/sys/signal.h:#define NSIG64               (SIGMAX64+1)
```

...this causes an overflow when we set num_signals from the value of
NSIG, per GCC:

```
/rpmbuild/BUILD/php-8.5.3/ext/pcntl/pcntl.c:216:25: warning: large integer implicitly truncated to unsigned type [-Woverflow]
  PCNTL_G(num_signals) = NSIG;
                         ^~~~
```

...when we try to use pcntl to i.e. install a signal handler, we get an
error from pcntl:

```
Fatal error: Uncaught ValueError: pcntl_signal(): Argument #1 ($signal) must be less than 0 in phar:///QOpenSys/pkgs/bin/composer/vendor/seld/signal-handler/src/SignalHandler.php:491
```

The easiest way to deal with this silly AIX behaviour is to just promote
the storage size.
2026-03-09 14:29:06 -03:00
David Carlier
148dc1dd66 Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/pgsql: Fix preprocessor guard typo that silently disabled a feature
2026-03-09 07:45:20 +00:00
David Carlier
b0470d1669 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/pgsql: Fix preprocessor guard typo that silently disabled a feature
2026-03-09 07:42:53 +00:00
武田 憲太郎
35d98cb6ce ext/pgsql: Fix preprocessor guard typo that silently disabled a feature
Fix `PQTRACE_SUPPRESS_TIMESTAMPS` guard misspelling in pgsql.stub.php.

The guard has been misspelled as `PQTRACE_SUPPPRESS_TIMESTAMPS`
(three P's) since 7ec8ae12c4, preventing the
`PGSQL_TRACE_SUPPRESS_TIMESTAMPS` constant from being registered.

close GH-21386
2026-03-09 07:41:04 +00:00
KentarouTakeda
c56e8caaed ext/pgsql, ext/pdo_pgsql: Remove preprocessor guards for symbols predating libpq 10 (#21384)
While working on php/doc-en#5409 to clean up outdated PostgreSQL
version notes in the documentation, I noticed that the source code
also retains #ifdef guards for symbols guaranteed to exist in
libpq >= 10.0 (the minimum enforced in build/php.m4 via
PQencryptPasswordConn).

Removed guards (all confirmed in PostgreSQL 10 documentation):

- `PG_DIAG_{INTERNAL_POSITION,INTERNAL_QUERY}`: libpq 8.0+
- `PG_DIAG_{SCHEMA,TABLE,COLUMN,DATATYPE,CONSTRAINT}_NAME`: libpq 9.3+
- `PG_DIAG_SEVERITY_NONLOCALIZED`: libpq 9.6+
- `CONNECTION_SSL_STARTUP`: libpq 8.0+
- `CONNECTION_CONSUME`: libpq 10.0+

Refs:
- https://www.postgresql.org/docs/10/libpq-exec.html#LIBPQ-PQRESULTERRORFIELD
- https://www.postgresql.org/docs/10/libpq-connect.html#LIBPQ-PQCONNECTSTARTPARAMS
- 53e31d5883/build/php.m4 (L1927)
2026-03-08 05:42:50 +00:00
Ilia Alshanetsky
53e31d5883 Fix GH-21362: ReflectionMethod::invoke() allows different Closures (#21366)
ReflectionMethod::invoke() (and invokeArgs()) for Closure::__invoke()
incorrectly accepted any Closure object, not just the one the
ReflectionMethod was created from. This happened because all Closures
share a single zend_ce_closure class entry, so the instanceof_function()
check always passed.

Fix: store the original Closure object in intern->obj during
ReflectionMethod construction, then compare object identity in
reflection_method_invoke() to reject different Closure instances.

Closes GH-21362
2026-03-07 17:19:33 -08:00
Kamil Tekiela
eedbffec2e Empty some values of mysqli_get_charset() (#21361)
* Stop reporting unhelpful values in mysqli_get_charset

* Remove element "comment" as it has been undocumented
2026-03-07 22:09:02 +00:00
Peter Kokot
58acc671db ext/mbstring: Fix deprecation warning (#21363)
This fixes the PHP deprecation warning:

    PHP Deprecated:  Implicit conversion from float 2048.96875 to int
    loses precision in .../ext/mbstring/gen_rare_cp_bitvec.php on line 9
2026-03-07 16:16:59 +01:00
David CARLIER
f830fa9948 Sockets refactoring 2026 (#21365)
ext/sockets: internal refactorings.

- remove redundant memsets and faster socket unix path copy.
- simplify php_open_listen_sock.
- use INADDR_ANY directly instead of resolving via gethostbyname.
- remove redundant memsets in conversions.
2026-03-07 14:09:49 +00:00
Gina Peter Banyard
f2d96c84f0 Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/session: Fix memory leak due to multiple exception happening during session abort
2026-03-07 13:30:28 +00:00
Gina Peter Banyard
10e02b0a4a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/session: Fix memory leak due to multiple exception happening during session abort
2026-03-07 13:30:15 +00:00
Gina Peter Banyard
0acde11945 ext/session: Fix memory leak due to multiple exception happening during session abort
Closes GH-21200

Co-authored-by: arshidkv12 <arshidkv12@gmail.com>
2026-03-07 13:28:42 +00:00
ndossche
61fd5ceb68 Merge branch 'PHP-8.5'
* PHP-8.5:
  Update ext/standard/libavifinfo
2026-03-07 11:18:33 +01:00
ndossche
37fbbbc4d3 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Update ext/standard/libavifinfo
2026-03-07 11:18:29 +01:00
Yannis
c3777c73b3 Update ext/standard/libavifinfo
Fixes GH-20627.
Closes GH-21250.
2026-03-07 11:17:56 +01:00
Peter Kokot
f99ca6347f Windows build: Use GREP_HEADER() instead of CHECK_FUNC_IN_HEADER() (#21315)
This removes the following unused compile definitions:

- HAVE_OSSL_SET_MAX_THREADS
- HAVE_ARGON2ID_HASH_RAW

The CHECK_FUNC_IN_HEADER() function defines the 'HAVE_<FUNCTION>'
compile definitions to 0 or 1, but these aren't used in the code.
Defining such preprocessor macros makes it difficult to track and sync
with other build systems.
2026-03-06 14:11:20 +01:00
Remi Collet
806e0d0c03 Merge branch 'PHP-8.5'
* PHP-8.5:
  zip is now 1.22.8
2026-03-06 09:55:12 +01:00
Remi Collet
1d7cddd3ce Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  zip is now 1.22.8
2026-03-06 09:54:55 +01:00
Remi Collet
fb80f35fdc zip is now 1.22.8 2026-03-06 09:54:32 +01:00
David Carlier
77925b971a Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-21333: use-after-free when unlinking entries during iteration of a compressed phar.
2026-03-05 22:32:38 +00:00
David Carlier
449361afbf Fix GH-21333: use-after-free when unlinking entries during iteration of a compressed phar.
close GH-21334
2026-03-05 22:31:49 +00:00
David Carlier
39f1ed4ae5 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-21336: undefined behavior in snmp setSecurity.
2026-03-05 18:52:08 +00:00
David Carlier
d08d80cf02 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21336: undefined behavior in snmp setSecurity.
2026-03-05 18:51:23 +00:00
David Carlier
41458c6ad6 Fix GH-21336: undefined behavior in snmp setSecurity.
close GH-21337
2026-03-05 18:48:39 +00:00
Alexandre Daubois
11a95749b1 Convert more zend_parse_parameters_none() to fast ZPP (#21330) 2026-03-04 14:07:46 +01:00
Ilija Tovilo
471ae15312 Fix incorrect zend_hash_find_ptr() on non-ptr in ReflectionProperty::isReadable() (GH-21339)
Fixes OSS-Fuzz #489355368
2026-03-04 12:55:58 +01:00
Petr Sumbera
ce1cadba29 Fix Solaris tests and add nightly CI job
Closes GH-20709
2026-03-04 10:12:03 +01:00
tekimen
7a1c2612c0 [RFC] Add grapheme_strrev function (#20949)
* [RFC] Add grapheme_strrev function

Add more tests Arabic for grapheme_strrev function.
2026-03-04 09:47:26 +09:00
Nora Dossche
84b0a73685 Fix GH-13204: glob() fails if square bracket is in current directory (#19647)
The problem is not limited to square brackets, but to every meta
character. The solution is to override the glob functions for handling
paths with the VCWD ones in PHP. If that is not available, use the old
but limited workaround.
2026-03-03 22:29:07 +01:00
Peter Kokot
f17c5ad83b Windows build: Add new function CHECK_HEADER() (#21191)
The current function `CHECK_HEADER_ADD_INCLUDE()` automatically defines
`HAVE_<HEADER_NAME_H>` preprocessor macros, which makes it difficult to
sync with other build systems. Specially, if some `HAVE_` macro is used
in the code and this function defines this macro but Autotools doesn't.

The new `CHECK_HEADER()` function behaves similar except it doesn't
define the `HAVE_<HEADER_NAME_H>` preprocessor macro.

This removes the following unused compile definitions:

HAVE_ARGON2_H
HAVE_AVIF_H
HAVE_BZLIB_H
HAVE_CAPSTONE_CAPSTONE_H
HAVE_CURL_EASY_H
HAVE_DB_H
HAVE_DECODE_H
HAVE_DEPOT_H
HAVE_EDITLINE_READLINE_H
HAVE_ENCHANT_H
HAVE_ENCODE_H
HAVE_FFI_H
HAVE_FIREBIRD_INTERFACE_H
HAVE_FT2BUILD_H
HAVE_GD_H
HAVE_GLIB_H
HAVE_GMP_H
HAVE_HTTPD_H
HAVE_IBASE_H
HAVE_IR_IR_H
HAVE_KECCAKHASH_H
HAVE_LBER_H
HAVE_LDAP_H
HAVE_LIBEXSLT_EXSLT_H
HAVE_LIBINTL_H
HAVE_LIBPQ_FE_H
HAVE_LIBTIDY_TIDY_H
HAVE_LIBXML_PARSER_H
HAVE_LIBXML_TREE_H
HAVE_LIBXML_XMLWRITER_H
HAVE_LIBXSLT_XSLT_H
HAVE_LMDB_H
HAVE_MBSTRING_H
HAVE_MYSQL_H
HAVE_ONIGURUMA_H
HAVE_OPENSSL_SSL_H
HAVE_PNG_H
HAVE_SNMP_H
HAVE_SODIUM_H
HAVE_SQLITE3_H
HAVE_SQLITE3EXT_H
HAVE_SYBFRONT_H
HAVE_TIDY_H
HAVE_TIDY_TIDY_H
HAVE_TIDYBUFFIO_H
HAVE_TIMELIB_CONFIG_H
HAVE_UNICODE_USPOOF_H
HAVE_UNICODE_UTF_H
HAVE_XPM_H
HAVE_ZIP_H
HAVE_ZIPCONF_H
HAVE_ZLIB_H

The following compile definitions are defined explicitly:

- HAVE_ICONV_H
- HAVE_MSCOREE_H
- HAVE_SQL_H
- HAVE_SQLEXT_H

Additionally, the `SETUP_OPENSSL()` function doesn't accept the 6th
argument anymore.
2026-03-03 20:06:40 +01:00
Ilija Tovilo
a83c025730 Use zend_always_inline for frameless function template functions (GH-21316) 2026-03-03 00:20:34 +01:00
ndossche
bfd66bbdf0 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix compile warnings under GCC 15.2.1 (#21320)
  Updated to version 2026.1 (2026a)
2026-03-02 23:13:40 +01:00
ndossche
210704258a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix compile warnings under GCC 15.2.1 (#21320)
2026-03-02 23:12:48 +01:00
Nora Dossche
583be5a8ca Fix compile warnings under GCC 15.2.1 (#21320)
The compiler now infers constness through string functions.
Adhere to that.
It also now warns about using multiplications in conditions.
2026-03-02 23:12:06 +01:00
Derick Rethans
832a5ea9c8 Updated to version 2026.1 (2026a) 2026-03-02 18:17:18 +00:00
Derick Rethans
043ade6d65 Updated to version 2026.1 (2026a) 2026-03-02 18:17:16 +00:00
Derick Rethans
04897559f0 Updated to version 2026.1 (2026a) 2026-03-02 18:17:14 +00:00
Derick Rethans
f437b39060 Updated to version 2026.1 (2026a) 2026-03-02 18:17:13 +00:00
ndossche
daf1d322da Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix pcre leak test (#21327)
2026-03-02 18:51:57 +01:00
ndossche
fa3c8eed16 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix pcre leak test (#21327)
2026-03-02 18:51:52 +01:00
Nora Dossche
4e831236f8 Fix pcre leak test (#21327)
We need an uninterned string to trigger the leak. The loop is also
unnecessary.
2026-03-02 18:51:29 +01:00
David Carlier
2fd3433ed0 Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/pcntl: add new tests to ver invalid signals handling.
2026-02-28 20:23:11 +00:00
David Carlier
2bbca7c9b9 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/pcntl: add new tests to ver invalid signals handling.
2026-02-28 20:23:00 +00:00
David Carlier
cf9d6f454a ext/pcntl: add new tests to ver invalid signals handling.
from pcntl_sigprocmask(), pcntl_sigwaitinfo(), and pcntl_sigtimedwait().

close GH-21297
2026-02-28 20:21:54 +00:00
ndossche
15a58cfe2f Merge branch 'PHP-8.5'
* PHP-8.5:
  [ci skip] Tweak SKIPIFs
2026-02-28 14:58:07 +01:00
ndossche
9200768a55 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  [ci skip] Tweak SKIPIFs
2026-02-28 14:58:02 +01:00
ndossche
cf180f237c [ci skip] Tweak SKIPIFs 2026-02-28 14:57:41 +01:00