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

134607 Commits

Author SHA1 Message Date
Niels Dossche
5e34bb8916 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-13094: range(9.9, '0') causes segmentation fault
2024-01-09 22:12:35 +01:00
Niels Dossche
1d6f344bea Fix GH-13094: range(9.9, '0') causes segmentation fault
`start_type + end_type < 2*IS_STRING` is not right, in this test case
the types are start_type==5 (IS_DOUBLE), end_type==7 (IS_ARRAY).
The IS_ARRAY type is a sentinel to disambiguate single-byte strings.
The path must be taken when one of the types is not a string nor a
single-byte string. Therefore, use < IS_STRING with an OR condition.

Closes GH-13105.
2024-01-09 22:11:45 +01:00
Tim Düsterhus
4cda181c11 [skip ci] Update ext/random year for myself in EXTENSIONS 2024-01-09 20:53:28 +01:00
Tim Düsterhus
162e1dce98 random: Optimize data flow for the generate function of native engines (#13043)
Instead of returning the generated `uint64_t` and providing the size (i.e. the
number of bytes of the generated value) out-of-band via the
`last_generated_size` member of the `php_random_status` struct, the `generate`
function is now expected to return a new `php_random_result` struct containing
both the `size` and the `result`.

This has two benefits, one for the developer:

It's no longer possible to forget setting `last_generated_size` to the correct
value, because it now happens at the time of returning from the function.

and the other benefit is for performance:

The `php_random_result` struct will be returned as a register pair, thus the
`size` will be directly available without reloading it from main memory.

Checking a simplified version of `php_random_range64()` on Compiler Explorer
(“Godbolt”) with clang 17 shows a single change in the resulting assembly
showcasing the improvement (https://godbolt.org/z/G4WjdYxqx):

    - add     rbp, qword ptr [r14]
    + add     rbp, rdx

Empirical testing confirms a measurable performance increase for the
`Randomizer::getBytes()` method:

    <?php
    $e = new Random\Engine\Xoshiro256StarStar(0);
    $r = new Random\Randomizer($e);

    var_dump(strlen($r->getBytes(100000000)));

goes from 250ms (before the change) to 220ms (after the change). While
generating 100 MB of random data certainly is not the most common use case, it
confirms the theoretical improvement in practice.
2024-01-09 19:04:29 +01:00
Dmitry Stogov
d778c24aa2 Merge branch 'PHP-8.3'
* PHP-8.3:
  Disable inlining and inter-procedure-analyses for zend_string_equal_val() function that may be overriden for valgrind (#13099)
2024-01-09 20:06:15 +03:00
Dmitry Stogov
71a1defdfa Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Disable inlining and inter-procedure-analyses for zend_string_equal_val() function that may be overriden for valgrind (#13099)
2024-01-09 20:06:07 +03:00
Dmitry Stogov
6339938c7e Disable inlining and inter-procedure-analyses for zend_string_equal_val() function that may be overriden for valgrind (#13099)
This is a more safely way to fix GH-9068
2024-01-09 20:05:51 +03:00
Ilija Tovilo
d7d0d19d32 Support index.php fallback for files in built-in server
If no router script is used, the built-in webserver will now look for a fallback
index file recursively in all cases, including URLs with a period.

Fixes GH-12604
Closes GH-12992
2024-01-09 16:13:39 +01:00
Ilija Tovilo
8876639d11 Add X-Powered-By header to builtin 404 page (#13092)
As requested by 30929c9a88 (r1434156785).
2024-01-09 16:10:39 +01:00
Ilija Tovilo
59c38969de [skip ci] Remove PHP 8.0 references from CI 2024-01-09 10:39:20 +01:00
Gabriel Caruso
811c5ff2f4 [ci skip] PHP 8.0 is EOL
Following php/web-php#840, 670052c42 and php/web-qa#c7b24521eb1
2024-01-09 01:46:59 +01:00
Peter Kokot
3b73db612b Remove unused symbol HAVE_ODBC2 (#13088) 2024-01-08 23:32:46 +01:00
Peter Kokot
6aad7a07bb Fix DragonFly build (#13085)
On DragonFly by default the BSD make is used with the CSH shell and the
first prerequisite variable `$<` in Makefile doesn't work there. So, we
can simplify this by simply repeating the filename here.
2024-01-08 23:32:30 +01:00
Máté Kocsis
8e38226abf Merge branch 'PHP-8.3'
* PHP-8.3:
  Backport upgrading PHP-Parser to PHP-8.3
2024-01-08 16:18:26 +01:00
Máté Kocsis
10e8a0d17e Backport upgrading PHP-Parser to PHP-8.3 2024-01-08 16:16:45 +01:00
Ilija Tovilo
d8df700e45 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix run-tests.php differ calculateCommonSubsequence for EXPECTF
2024-01-08 13:36:51 +01:00
Ilija Tovilo
379e913e1a Fix run-tests.php differ calculateCommonSubsequence for EXPECTF
calculateCommonSubsequence should not contain regexes.

Fixes GH-13083
Closes GH-13084
2024-01-08 13:36:29 +01:00
Máté Kocsis
281555d02d Migrate to the final version of PHP-Parser 5.0.0 2024-01-08 00:14:13 +01:00
Jorg Adam Sowa
73722df439 Improve preg_* functions warnings for NUL byte (#13068)
* Improve error messages for preg_ functions
* Adjusted tests and fixed formatting
* Removed unnecessary strings from preg_* tests
* Removed ZPP tests
2024-01-07 13:40:54 +00:00
haszi
90800b62bb Change PHP_ZTS and PHP_DEBUG to bool to match their ZEND equivalents (#13079)
Co-authored-by: haszi <haszika80@gmail.com>
2024-01-07 13:38:26 +00:00
Peter Kokot
6f3888fe9a Remove root library check for dlopen() and dlsym() (#13086)
The root library was added here for the Haiku system, to check dlopen()
and dlsym(). However, the root library is already explicitly linked in
the system, and it does not need to be checked neither linked anymore,
since at least ~2013.
2024-01-07 10:07:17 +01:00
Peter Kokot
2fec3e7f41 Remove unused phpdbg build variables (#13078)
- PHP_PHPDBG_CFLAGS and PHP_PHPDBG_FILES were once used in the generated
  Makefile.
- BUILD_PHPDBG check was used together with unused and obsolete phpdbg
  webhelper configuration.
2024-01-06 18:52:55 +01:00
Arnaud Le Blanc
44a246ed6d Merge branch 'PHP-8.3'
* PHP-8.3:
  [ci skip] NEWS
  [ci skip] NEWS
  Fix timer leak (#13027)
2024-01-05 19:47:58 +01:00
Arnaud Le Blanc
3a237b96a0 [ci skip] NEWS 2024-01-05 19:47:08 +01:00
Arnaud Le Blanc
26f54eb490 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS
  Fix timer leak (#13027)
2024-01-05 19:45:51 +01:00
Arnaud Le Blanc
29cb814836 [ci skip] NEWS 2024-01-05 19:45:18 +01:00
Peter Kokot
22ec2585a1 Omit HAVE_INET_NTOP definition with AC_CHECK_FUNC (#13073)
Following the bb1109d9f1 this now doesn't
define the unused symbol HAVE_INET_NTOP also in Autotools build system.
2024-01-05 19:41:54 +01:00
Rob Landers
6342f735b9 Fix timer leak (#13027)
ts_resource() and php_request_startup() both eventually call zend_max_execution_timer_init(), which didn't have a guard to prevent recreating timers, thus resulting in leaking timers. This adds a guard to prevent the leak.
2024-01-05 19:36:19 +01:00
Niels Dossche
67eb196f1e Remove unused Lexbor file 2024-01-05 17:21:22 +01:00
Niels Dossche
dced97c02f Update Lexbor 2024-01-05 17:21:08 +01:00
Jakub Zelenka
1612a716a0 [ci-skip] Add missing credit for openssl_csr_sign serial_hex to Florian 2024-01-05 14:43:29 +00:00
Jakub Zelenka
e0679f3d5e Introduce new serial_hex parameter to openssl_csr_sign
Co-authored-by: Florian Sowade <f.sowade@suora.com>

Closes GH-13023
Closes GH-9851
2024-01-05 14:40:22 +00:00
Peter Kokot
bb1109d9f1 Remove unused HAVE_INET_NTOP
The inet_ntop() is always required and present via
931a8b0739.
2024-01-04 20:48:17 +01:00
Peter Kokot
b632528eb3 Merge branch 'PHP-8.3'
* PHP-8.3:
  Update year to 2024
2024-01-04 19:30:19 +01:00
Peter Kokot
bafb17adcf Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Update year to 2024
2024-01-04 19:29:37 +01:00
Peter Kokot
2575e6b88c Update year to 2024 2024-01-04 19:26:32 +01:00
Peter Kokot
2caa2fe00d Remove libbind from build system (#12991)
Linking with -lbind is no longer relevant. The libbind was once part of
the ISC project bind9. In 2013, maintenance was moved to NetBSD which
integrated it into netresolv.

[1]: https://www.isc.org/othersoftware/#libbind
[2]: https://wiki.netbsd.org/individual-software-releases/netresolv/
2024-01-04 19:23:46 +01:00
Máté Kocsis
0b7cd1423a Add upgrading note about PHP_OUTPUT_HANDLER_PROCESSED
[skip-ci]
2024-01-04 16:05:49 +01:00
haszi
c1a8cc59cc Add PHP_OUTPUT_HANDLER_PROCESSED constant to stubs 2024-01-04 15:57:12 +01:00
Niels Dossche
14bdb01f8c Fix failing 32-bit mbstring tests (#13069) 2024-01-04 08:30:17 +01:00
Niels Dossche
ddbc74c419 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix #71465: PHAR doesn't know about litespeed
2024-01-03 21:35:09 +01:00
Niels Dossche
7525e690f6 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix #71465: PHAR doesn't know about litespeed
2024-01-03 21:34:59 +01:00
Niels Dossche
85dbbe19e2 Fix #71465: PHAR doesn't know about litespeed
We should perhaps look into a generic system to ask the SAPI whether
a feature should be supported or not. Or, we should look into making
a denylist instead of an allowlist.
Anyway, let's not try doing anything fancy on stable branches.

Closes GH-13070.
2024-01-03 21:31:09 +01:00
Niels Dossche
03547f6832 Remove properties field from php_libxml_node_object (#13062)
This shrinks the struct from 80 bytes to 72 bytes.
This was unused internally, I did not find users externally via GitHub
search.
The intention for this was that it could be used for attaching extra
data as a 3rd party to a node. However, there are better mechanisms for
that like using actual objects.
2024-01-03 20:03:56 +01:00
Peter Kokot
96ee0787cf Remove unused php.sym files (#13065)
These were used with the --enable-versioning option and are no longer
used like this.

Removed via b0ef04af84

At this time, sapi/cgi, sapi/cli, and sapi/fpm create and use php.sym
file at the build phase in the php-src project root directory only on
AIX platform.
2024-01-03 19:31:58 +01:00
David Carlier
ba9cf25298 Merge branch 'PHP-8.3' 2024-01-03 17:35:44 +00:00
David Carlier
b32a1cc76f Merge branch 'PHP-8.2' into PHP-8.3 2024-01-03 17:34:54 +00:00
David Carlier
96ffe6ad7e ext/intl: fix bug introduced by 5455c3f
was meant to fix GH-12943.

Close GH-13001.
2024-01-03 17:33:27 +00:00
Jakub Zelenka
2fe05c8980 Merge branch 'PHP-8.3' 2024-01-02 15:52:00 +00:00
Jakub Zelenka
d33a534863 PHP-8.3 is now for PHP-8.3.3-dev 2024-01-02 15:50:36 +00:00