Commit Graph

135338 Commits

Author SHA1 Message Date
Arnaud Le Blanc
e220e84b36 [ci skip] 2024-03-05 12:19:59 +01:00
Arnaud Le Blanc
6b57e2d988 Fix GH-13569: GC buffer unnecessarily grows up to GC_MAX_BUF_SIZE when scanning WeakMaps 2024-03-05 12:17:21 +01:00
Remi Collet
9e132582a1
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-13217 Test failure with zlib-ng
2024-03-05 10:13:57 +01:00
Remi Collet
6a3c083200
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-13217 Test failure with zlib-ng
2024-03-05 10:13:40 +01:00
Remi Collet
5e12844d4d
Fix GH-13217 Test failure with zlib-ng
As compressed result may be different
- drop or relax expectations on compressed data
- rely on uncompressed result of compressed data
2024-03-05 10:13:22 +01:00
Dmitry Stogov
2066bf1e18 Update IR
IR commit: 2bc594304cb40ebc3930c529a6ade7d121d5e00b
2024-03-05 11:33:02 +03:00
Dmitry Stogov
cab88ddb7d IR Update
IR commit: b9c5fd8d691f576a6a9ae4ad2464ea51e18203a5
2024-03-04 22:56:36 +03:00
David CARLIER
e3b6872b51
zend call stack adjust case for freebsd to calculate the guard size. (#13586)
it was not wrong but there is a sysctl oid storing the number of guard
pages, which is 1 by default but is modifiable at runtime.
2024-03-04 19:06:37 +00:00
Tim Düsterhus
3d4cb1da3e
random: Convert RANDOM_SEED() from a macro to a function (#13575)
* random: Convert `RANDOM_SEED()` from a macro to a function

* random: Fix GENERATE_SEED()'s prototype
2024-03-04 19:51:17 +01:00
Tim Düsterhus
06569bbd04
random: Clean Up the Mt19937 state struct (#13577)
* random: Make Mt19937's `mode` field an enum

* random: Reorder the `php_random_status_state_mt19937` struct

Empirical testing did not show any differences in performance, but it makes
sense to me to put the `count` field (which is accessed for every invocation of
Mt19937) at the beginning of the struct, keeping it near the values from the
state array that are returned first, resulting in only a single cache line load
if only a small amount of numbers are requested.

It naturally follows to also put the `mode` field there and move the
humongous state array to the end.

* random: Remove the `MT_N` constant

`MT_N` is an awfully generic name that bleeds into every file including
`php_random.h`. As it's an implementation detail, remove it entirely to keep
`php_random.h` clean.

To prevent the state struct from diverging from the implementation, the size of
the state vector is statically verified. Furthermore there are phpt tests
verifying the Mt19937 output across a reload, revealing when the state vector
is reloaded too early or too late.
2024-03-04 19:51:01 +01:00
Tim Düsterhus
650a8fb098
random: Embed the Mt19937 and CombinedLCG state within the module globals (#13579)
These are always dynamically allocated in GINIT, thus always take up memory. By
embedding them here we can avoid the dynamic allocation and additional pointer
indirection accessing them.

The test script:

    <?php
    for ($i = 0; $i < 9999999; $i++) mt_rand(1, 100);

Appears to run slightly faster with this change applied: Before this change it
always ran in just over 3 seconds, after this change I was also seeing times
below 3 seconds. Howver results are too close and too jittery to state this
performance improvement as a fact.
2024-03-04 17:51:40 +01:00
Niels Dossche
ad1dfa35f2
Minor PDO conditions cleanup (#13584)
* Get rid of inverted NULL checks

As the dbh pointer is already used in address computation,
the NULL checks is redundant. Looking at the callers
there are no cases where this can be passed as NULL.

* Message can't be NULL here

* Remove null check for return_value

As one of the branches dereferences return_value unconditionally, the
NULL check is dubious. In fact, looking at the callers we see that
return_value can never be NULL. So remove the check and fix the comment.
2024-03-04 17:36:51 +01:00
David Carlier
3f05418e8b Merge branch 'PHP-8.3' 2024-03-04 15:37:24 +00:00
David Carlier
eef44d2291 Merge branch 'PHP-8.2' into PHP-8.3 2024-03-04 15:35:21 +00:00
David Carlier
9999a0cb75 ext/gettext: dcgettext/dcngettext sigabrt on macOs.
the man page states `the locale facet is determined by the category argument,  which  should  be
 one of the LC_xxx constants defined in the <locale.h> header, excluding LC_ALL`,
since the 0.22.5 release, sanity checks had been strenghtened leading to
an abort with the Zend/tests/arginfo_zpp_mismatch.phpt test setting the
category to 0 which is LC_ALL on macOs.

close GH-13555
2024-03-04 15:34:59 +00:00
Saki Takamachi
f799d6fdd4
Merge branch 'PHP-8.3'
* PHP-8.3:
  NEWS
  Fixed handshake response charset. (#13470)
  Fixed handshake response charset. (#13470)
  [skip ci] Fixed NEWS
2024-03-04 21:59:40 +09:00
Saki Takamachi
23d89e3851
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed handshake response charset. (#13470)
  [skip ci] Fixed NEWS
2024-03-04 21:57:56 +09:00
Saki Takamachi
e9c5f0504c
Fixed handshake response charset. (#13470)
The character set ID included in the handshake data at the time of connection
actually only includes the lower 8 bits of the ID, so if  try to use this to specify
a character set, the corresponding character set may not exist.

In case of an invalid character set, the default character set is now used
without an error.

Fixes #13452
Closes #13470
2024-03-04 21:53:52 +09:00
Saki Takamachi
72779e6d64
NEWS 2024-03-04 21:53:48 +09:00
Saki Takamachi
7466f9c99c
Fixed handshake response charset. (#13470)
The character set ID included in the handshake data at the time of connection
actually only includes the lower 8 bits of the ID, so if  try to use this to specify
a character set, the corresponding character set may not exist.

In case of an invalid character set, the default character set is now used
without an error.

Fixes #13452
Closes #13470
2024-03-04 21:53:48 +09:00
Saki Takamachi
29a39eb782
Fixed handshake response charset. (#13470)
The character set ID included in the handshake data at the time of connection
actually only includes the lower 8 bits of the ID, so if  try to use this to specify
a character set, the corresponding character set may not exist.

In case of an invalid character set, the default character set is now used
without an error.

Fixes #13452
Closes #13470
2024-03-04 21:51:02 +09:00
Saki Takamachi
6bcce681ef
[skip ci] Fixed NEWS 2024-03-04 21:50:37 +09:00
Saki Takamachi
bfacc4146f
Merge branch 'PHP-8.3'
* PHP-8.3:
  Added validation of `\n` in $additional_headers of mail()
2024-03-04 21:30:58 +09:00
Saki Takamachi
04eeaa0bc7
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Added validation of `\n` in $additional_headers of mail()
2024-03-04 21:30:27 +09:00
Saki Takamachi
04e8e55f47
Added validation of \n in $additional_headers of mail()
When $additional_headers of mail() is an array, the same validation as
`\r\n` is now applied to `\n` alone too.
2024-03-04 21:30:07 +09:00
Peter Kokot
f91dcad567
Remove duplicate phpdbg _GNU_SOURCE compile definition (#13585)
The _GNU_SOURCE is defined on few other places when compiling phpdbg
(CPPFLAGS and php_config.h) depending on the system.
2024-03-03 23:59:01 +01:00
Peter Kokot
734f686ac4
Simplify UFFDIO_WRITEPROTECT_MODE_WP Autoconf check (#13564)
AC_CHECK_DECL can check whether preprocessor macro is defined in the
given includes.
2024-03-02 22:48:41 +01:00
David Carlier
7f01871915 ext/gettext: bind_textdomain_codeset should not accept empty domains.
the man page specifies that for bind_textdomain_codeset, like
bindtextdomain, the domain should not be an empty string.

close GH-13571
2024-03-02 18:59:18 +00:00
Ayesh Karunaratne
1b380d6ad5
UPGRADING: Minor adjustments moving items to appropriate sections (#13576)
- Moved curl_version()['feature_list'] to New Features
- Moved NumberFormatter::ROUND_HALFODD to New Features
- Removed contributor names (this pattern only used in the `NEWS` file)
- Removed "Fixed setAttribute and getAttribute" as it is covered in another change record
2024-03-02 19:34:03 +01:00
Tim Düsterhus
f6c38fc952 session: Stop using php_combined_lcg()
The CombinedLCG is a terrible RNG with a questionable API and should ideally
not be used anymore. While in the case of ext/session it is only used for
probabilistic garbage collection where the quality of the RNG is not of
particular importance, there are better choices.

Replace the RNG used for garbage collection by an ext/session specific instance
of PcgOneseq128XslRr64. Its 16 Byte state nicely fits into the memory freed up
by the previous reordering of the session globals struct, even allowing to the
storage of the php_random_algo_with_state struct, making using the RNG a little
nicer.

Instead multiplying the float returned by the CombinedLCG by the GC Divisor to
obtain an integer between 0 and the divisor we can just use `php_random_range`
to directly generate an appropriate integer, completely avoiding the floating
point maths, making it easier to verify the code for correctness.
2024-03-02 11:29:15 +00:00
Tim Düsterhus
4df911efcb session: Slightly reorder the members within the module globals
The previous ordering resulted in a needlessly large number of holes and split
several `zval`s across cache line boundaries. Do the bare minimum of reordering
to keep related members grouped, but reducing the struct size by 32 bytes and
keeping `zval`s within a single cache line.

Before:

    struct _php_session_rfc1867_progress {
            size_t                     sname_len;            /*     0     8 */
            zval                       sid;                  /*     8    16 */
            smart_str                  key;                  /*    24    16 */
            zend_long                  update_step;          /*    40     8 */
            zend_long                  next_update;          /*    48     8 */
            double                     next_update_time;     /*    56     8 */
            /* --- cacheline 1 boundary (64 bytes) --- */
            _Bool                      cancel_upload;        /*    64     1 */
            _Bool                      apply_trans_sid;      /*    65     1 */

            /* XXX 6 bytes hole, try to pack */

            size_t                     content_length;       /*    72     8 */
            zval                       data;                 /*    80    16 */
            zval *                     post_bytes_processed; /*    96     8 */
            zval                       files;                /*   104    16 */
            zval                       current_file;         /*   120    16 */
            /* --- cacheline 2 boundary (128 bytes) was 8 bytes ago --- */
            zval *                     current_file_bytes_processed; /*   136     8 */

            /* size: 144, cachelines: 3, members: 14 */
            /* sum members: 138, holes: 1, sum holes: 6 */
            /* last cacheline: 16 bytes */
    };
    struct _php_ps_globals {
            char *                     save_path;            /*     0     8 */
            char *                     session_name;         /*     8     8 */
            zend_string *              id;                   /*    16     8 */
            char *                     extern_referer_chk;   /*    24     8 */
            char *                     cache_limiter;        /*    32     8 */
            zend_long                  cookie_lifetime;      /*    40     8 */
            char *                     cookie_path;          /*    48     8 */
            char *                     cookie_domain;        /*    56     8 */
            /* --- cacheline 1 boundary (64 bytes) --- */
            _Bool                      cookie_secure;        /*    64     1 */
            _Bool                      cookie_httponly;      /*    65     1 */

            /* XXX 6 bytes hole, try to pack */

            char *                     cookie_samesite;      /*    72     8 */
            const ps_module  *         mod;                  /*    80     8 */
            const ps_module  *         default_mod;          /*    88     8 */
            void *                     mod_data;             /*    96     8 */
            php_session_status         session_status;       /*   104     4 */

            /* XXX 4 bytes hole, try to pack */

            zend_string *              session_started_filename; /*   112     8 */
            uint32_t                   session_started_lineno; /*   120     4 */

            /* XXX 4 bytes hole, try to pack */

            /* --- cacheline 2 boundary (128 bytes) --- */
            zend_long                  gc_probability;       /*   128     8 */
            zend_long                  gc_divisor;           /*   136     8 */
            zend_long                  gc_maxlifetime;       /*   144     8 */
            int                        module_number;        /*   152     4 */

            /* XXX 4 bytes hole, try to pack */

            zend_long                  cache_expire;         /*   160     8 */
            struct {
                    zval               ps_open;              /*   168    16 */
                    zval               ps_close;             /*   184    16 */
                    /* --- cacheline 3 boundary (192 bytes) was 8 bytes ago --- */
                    zval               ps_read;              /*   200    16 */
                    zval               ps_write;             /*   216    16 */
                    zval               ps_destroy;           /*   232    16 */
                    zval               ps_gc;                /*   248    16 */
                    /* --- cacheline 4 boundary (256 bytes) was 8 bytes ago --- */
                    zval               ps_create_sid;        /*   264    16 */
                    zval               ps_validate_sid;      /*   280    16 */
                    zval               ps_update_timestamp;  /*   296    16 */
            } mod_user_names;                                /*   168   144 */
            _Bool                      mod_user_implemented; /*   312     1 */
            _Bool                      mod_user_is_open;     /*   313     1 */

            /* XXX 6 bytes hole, try to pack */

            /* --- cacheline 5 boundary (320 bytes) --- */
            zend_string *              mod_user_class_name;  /*   320     8 */
            const struct ps_serializer_struct  * serializer; /*   328     8 */
            zval                       http_session_vars;    /*   336    16 */
            _Bool                      auto_start;           /*   352     1 */
            _Bool                      use_cookies;          /*   353     1 */
            _Bool                      use_only_cookies;     /*   354     1 */
            _Bool                      use_trans_sid;        /*   355     1 */

            /* XXX 4 bytes hole, try to pack */

            zend_long                  sid_length;           /*   360     8 */
            zend_long                  sid_bits_per_character; /*   368     8 */
            _Bool                      send_cookie;          /*   376     1 */
            _Bool                      define_sid;           /*   377     1 */

            /* XXX 6 bytes hole, try to pack */

            /* --- cacheline 6 boundary (384 bytes) --- */
            php_session_rfc1867_progress * rfc1867_progress; /*   384     8 */
            _Bool                      rfc1867_enabled;      /*   392     1 */
            _Bool                      rfc1867_cleanup;      /*   393     1 */

            /* XXX 6 bytes hole, try to pack */

            char *                     rfc1867_prefix;       /*   400     8 */
            char *                     rfc1867_name;         /*   408     8 */
            zend_long                  rfc1867_freq;         /*   416     8 */
            double                     rfc1867_min_freq;     /*   424     8 */
            _Bool                      use_strict_mode;      /*   432     1 */
            _Bool                      lazy_write;           /*   433     1 */
            _Bool                      in_save_handler;      /*   434     1 */
            _Bool                      set_handler;          /*   435     1 */

            /* XXX 4 bytes hole, try to pack */

            zend_string *              session_vars;         /*   440     8 */

            /* size: 448, cachelines: 7, members: 48 */
            /* sum members: 404, holes: 9, sum holes: 44 */
    };

After:

    struct _php_session_rfc1867_progress {
            size_t                     sname_len;            /*     0     8 */
            zval                       sid;                  /*     8    16 */
            smart_str                  key;                  /*    24    16 */
            zend_long                  update_step;          /*    40     8 */
            zend_long                  next_update;          /*    48     8 */
            double                     next_update_time;     /*    56     8 */
            /* --- cacheline 1 boundary (64 bytes) --- */
            _Bool                      cancel_upload;        /*    64     1 */
            _Bool                      apply_trans_sid;      /*    65     1 */

            /* XXX 6 bytes hole, try to pack */

            size_t                     content_length;       /*    72     8 */
            zval                       data;                 /*    80    16 */
            zval                       files;                /*    96    16 */
            zval *                     post_bytes_processed; /*   112     8 */
            zval *                     current_file_bytes_processed; /*   120     8 */
            /* --- cacheline 2 boundary (128 bytes) --- */
            zval                       current_file;         /*   128    16 */

            /* size: 144, cachelines: 3, members: 14 */
            /* sum members: 138, holes: 1, sum holes: 6 */
            /* last cacheline: 16 bytes */
    };
    struct _php_ps_globals {
            char *                     save_path;            /*     0     8 */
            char *                     session_name;         /*     8     8 */
            zend_string *              id;                   /*    16     8 */
            char *                     extern_referer_chk;   /*    24     8 */
            char *                     cache_limiter;        /*    32     8 */
            zend_long                  cookie_lifetime;      /*    40     8 */
            char *                     cookie_path;          /*    48     8 */
            char *                     cookie_domain;        /*    56     8 */
            /* --- cacheline 1 boundary (64 bytes) --- */
            char *                     cookie_samesite;      /*    64     8 */
            _Bool                      cookie_secure;        /*    72     1 */
            _Bool                      cookie_httponly;      /*    73     1 */

            /* XXX 6 bytes hole, try to pack */

            const ps_module  *         mod;                  /*    80     8 */
            const ps_module  *         default_mod;          /*    88     8 */
            void *                     mod_data;             /*    96     8 */
            php_session_status         session_status;       /*   104     4 */

            /* XXX 4 bytes hole, try to pack */

            zend_string *              session_started_filename; /*   112     8 */
            uint32_t                   session_started_lineno; /*   120     4 */
            int                        module_number;        /*   124     4 */
            /* --- cacheline 2 boundary (128 bytes) --- */
            zend_long                  gc_probability;       /*   128     8 */
            zend_long                  gc_divisor;           /*   136     8 */
            zend_long                  gc_maxlifetime;       /*   144     8 */
            zend_long                  cache_expire;         /*   152     8 */
            struct {
                    zval               ps_open;              /*   160    16 */
                    zval               ps_close;             /*   176    16 */
                    /* --- cacheline 3 boundary (192 bytes) --- */
                    zval               ps_read;              /*   192    16 */
                    zval               ps_write;             /*   208    16 */
                    zval               ps_destroy;           /*   224    16 */
                    zval               ps_gc;                /*   240    16 */
                    /* --- cacheline 4 boundary (256 bytes) --- */
                    zval               ps_create_sid;        /*   256    16 */
                    zval               ps_validate_sid;      /*   272    16 */
                    zval               ps_update_timestamp;  /*   288    16 */
            } mod_user_names;                                /*   160   144 */
            zend_string *              mod_user_class_name;  /*   304     8 */
            _Bool                      mod_user_implemented; /*   312     1 */
            _Bool                      mod_user_is_open;     /*   313     1 */
            _Bool                      auto_start;           /*   314     1 */
            _Bool                      use_cookies;          /*   315     1 */
            _Bool                      use_only_cookies;     /*   316     1 */
            _Bool                      use_trans_sid;        /*   317     1 */
            _Bool                      send_cookie;          /*   318     1 */
            _Bool                      define_sid;           /*   319     1 */
            /* --- cacheline 5 boundary (320 bytes) --- */
            const struct ps_serializer_struct  * serializer; /*   320     8 */
            zval                       http_session_vars;    /*   328    16 */
            zend_long                  sid_length;           /*   344     8 */
            zend_long                  sid_bits_per_character; /*   352     8 */
            php_session_rfc1867_progress * rfc1867_progress; /*   360     8 */
            char *                     rfc1867_prefix;       /*   368     8 */
            char *                     rfc1867_name;         /*   376     8 */
            /* --- cacheline 6 boundary (384 bytes) --- */
            zend_long                  rfc1867_freq;         /*   384     8 */
            double                     rfc1867_min_freq;     /*   392     8 */
            _Bool                      rfc1867_enabled;      /*   400     1 */
            _Bool                      rfc1867_cleanup;      /*   401     1 */
            _Bool                      use_strict_mode;      /*   402     1 */
            _Bool                      lazy_write;           /*   403     1 */
            _Bool                      in_save_handler;      /*   404     1 */
            _Bool                      set_handler;          /*   405     1 */

            /* XXX 2 bytes hole, try to pack */

            zend_string *              session_vars;         /*   408     8 */

            /* size: 416, cachelines: 7, members: 48 */
            /* sum members: 404, holes: 3, sum holes: 12 */
            /* last cacheline: 32 bytes */
    };
2024-03-02 11:29:15 +00:00
Peter Kokot
ffc6f192a8
Simplify port_create Autoconf check (#13529)
Similar simplification as e72f0c887b.
2024-03-02 00:16:19 +01:00
Peter Kokot
42a4e50513
Sync logical operators in shell scripting code (#13560)
This updates the obsolescent `-a` and `-o` binary primaries to `&&` and
`||`.

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
2024-03-01 20:40:16 +01:00
Peter Kokot
b5e2f3a4b6
Check FFI_* ABI with Autoconf AC_CHECK_DECL (#13552)
The FFI_* calling conventions are enum constants and AC_CHECK_DECL(S)
can be used to check for their existence in the ffi.h header. This
simplifes the checks and adds a simple AC_CHECK_DECL macro wrapper which
defines the HAVE_FFI_* belonging symbols.
2024-03-01 19:31:55 +01:00
Niels Dossche
3c98b1de3a Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-11808: Live filesystem modified by tests (security)
2024-03-01 18:46:39 +01:00
Niels Dossche
dfd37c7175 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-11808: Live filesystem modified by tests (security)
2024-03-01 18:46:30 +01:00
Niels Dossche
7c8a3e426e Fix GH-11808: Live filesystem modified by tests (security)
There's a test that tries to make /etc world-writable, and asserts that
it fails. Although this test is guarded by a root user check, there are
situations where you don't need to be root to be able to do this.
This may thus have unwanted effects on your live filesystem.

The simple solution is to remove that part of the test. It doesn't
really add value anyway: we're trying to test the chmod error path, but
that exact same error path can be reached with any failure condition
that the kernel gives. For example, trying to chmod a non-existent file
will trigger the same code path.

While at it, also prefix the test path for the non-existent file such
that we don't accidentally modify the filesystem.

The chroot now has a better root-user check, that will not modify the
filesystem.

Other root-modifying mkdir tests were removed because they added no
value either.

Closes GH-13566.
2024-03-01 18:45:54 +01:00
Peter Kokot
7d0e2d8e4d
Add missing memfd_create Autoconf check for bundled pcre2lib (#13561)
This moves memfd_create (HAVE_MEMFD_CREATE) to configure.ac. Since
ext/pcre is always enabled and check can be done in this case for
ext/pcre and ext/opcache at once.
2024-03-01 17:17:28 +01:00
Peter Kokot
a48ed12ea9
Find and link network library as needed with AC_SEARCH_LIBS (#13553)
This prepends -lnetwork as needed (Haiku) whether linker sees the
setsockopt function and avoids defining redundant symbols, such as
HAVE_LIBNETWORK and HAVE_SETSOCKOPT.
2024-02-29 22:04:13 +01:00
David CARLIER
6b6e33ddbe
adding myself as ext/gettext reviewer. (#13559) 2024-02-29 20:22:50 +00:00
Tim Düsterhus
61d8c77676
Merge branch 'PHP-8.3'
* PHP-8.3:
  [ci skip] Fix version for GH-13544 in NEWS
2024-02-29 18:22:08 +01:00
Tim Düsterhus
8ce3478fdd
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] Fix version for GH-13544 in NEWS
2024-02-29 18:21:57 +01:00
Tim Düsterhus
abfe5ffded
[ci skip] Fix version for GH-13544 in NEWS
Apparently PHP 8.2.17 was branched off after creating the PR and before merging
it, placing the NEWS in the wrong location.
2024-02-29 18:21:03 +01:00
Tim Düsterhus
54079babf8
Merge branch 'PHP-8.3'
* PHP-8.3:
  random: Fix unknown `mt_srand()` compatibility for unknown modes (#13544)
  Merge branch 'PHP-8.2' into PHP-8.3
  Removed `REPORT_EXIT_STATUS=no` in libmysql tests
  Revert "Fix GH-13519: PGSQL_CONNECT_FORCE_RENEW with persistent connections." (#13546)
2024-02-29 18:15:09 +01:00
Tim Düsterhus
e6c0b09e88
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  random: Fix unknown `mt_srand()` compatibility for unknown modes (#13544)
  Removed `REPORT_EXIT_STATUS=no` in libmysql tests
  Revert "Fix GH-13519: PGSQL_CONNECT_FORCE_RENEW with persistent connections." (#13546)
2024-02-29 18:10:39 +01:00
Tim Düsterhus
e059498c04
random: Fix unknown mt_srand() compatibility for unknown modes (#13544)
PHP 8.1 and below interpreted unknown modes as `MT_RAND_MT19937`, but PHP 8.2+
interprets them as `MT_RAND_PHP`.

Align the behavior with PHP 8.1 and below, because folks should be steered
towards the standard mode.
2024-02-29 18:05:59 +01:00
Gina Peter Banyard
47a199c8b4
Add http_(get|clear)_last_reponse_headers() functions (#12500)
This is to provide an alternative to the $http_response_header magic variable

RFC: https://wiki.php.net/rfc/http-last-response-headers
2024-02-29 16:41:09 +00:00
Tim Düsterhus
99e7cf074b
random: Clean up seeding API (#13540)
* random: Expose xoshiro256**'s seeding functions

* random: Expose pcgoneseq128xslrr64's seeding functions

* random: Expose Mt19937's seeding functions

* random: Expose CombinedLCG's seeding functions

* random: Call php_random_mt19937_seed32 to seed the global Mt19937

This avoids the function pointer indirection and improves type safety.

* random: NULL the generic seeding function

Different engines work quite differently, it is not useful to attempt to seed
them in a generic way using a 64 bit integer. As an example Mt19937 completely
ignores the upper 32 bits.

* random: Remove the `seed` member from `php_random_algo`

See the explanation in the previous commit for the reasoning. This member is
unused since the previous commit and was not consistently available even before
that (specifically for the Secure engine).

* UPGRADING.INTERNALS

* random: Remove useless cast in `php_mt_srand()`
2024-02-29 08:03:35 +01:00
Saki Takamachi
a31edaa99b
Merge branch 'PHP-8.3'
* PHP-8.3:
    Removed `REPORT_EXIT_STATUS=no` in libmysql tests
2024-02-29 08:49:53 +09:00
Saki Takamachi
116166cd30
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Removed `REPORT_EXIT_STATUS=no` in libmysql tests
2024-02-29 08:49:04 +09:00