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

141821 Commits

Author SHA1 Message Date
Tim Düsterhus
ca49a7bec2 RFC: Turn clone() into a function (#18919)
RFC: https://wiki.php.net/rfc/clone_with_v2

Co-authored-by: Volker Dusch <volker@tideways-gmbh.com>
2025-06-24 20:14:40 +02:00
Niels Dossche
5ed8b2be55 Fix GH-18897: printf: empty precision is interpreted as precision 6, not as precision 0 (#18912)
Like in other languages, and especially C where printf originates from,
a missing precision should be treated as a 0 precision.
Because the ADJ_PRECISION flag was not set, the double formatting code
resetted the precision to the default float precision of 6.
2025-06-24 19:06:47 +02:00
Tim Düsterhus
39cf27689b php_gdb: Print some numeric fields as hexadecimal (#18925)
* php_gdb: Print `zend_string*`’s `h` field as hexadecimal

A decimal representation of a hash value is not particularly meaningful and
makes it harder to compare hash values.

* php_gdb: Print `HashTable*`’s `nTableMask` field as hexadecimal
2025-06-24 15:22:25 +02:00
Saki Takamachi
537ae4f990 removed ZEND_IS_XDIGIT() (#18926) 2025-06-24 20:40:09 +09:00
Jakub Zelenka
fc04966c36 Add NEWS and UPGRADING for sendmail error handling changes 2025-06-24 12:30:35 +02:00
Jesse Hathaway
6a7561203d mail: add logging on errors
Prior to this commit the exit code of the sendmail command, called by
the mail function was lost, since the mail function only returns true or
false. Add additional logging to the mail function to capture the exit
code when the sendmail command fails.
2025-06-24 11:55:45 +02:00
Jesse Hathaway
c5e7490963 mail: fix exit code handling of sendmail cmd
Prior to this commit the return code of the pclose function was assumed
to be the exit code of the process. However, the returned value as
specified in wait(2) is a bit packed integer and must be interpreted
with the provided macros. This has no effect in success cases as the
integer is still zero, but in failure cases the wrong value is used,
since the 8 least significant bits contain the status code. After this
commit we use the macros to obtain the status code, which fixes the
EX_TEMPFAIL conditional.

For WIN32 the TSRM popen_ex and pclose function are used. The return
value of TSRM's pclose is not bit packed so we only check if the return
value is non-zero, which should solve, #43327,
https://bugs.php.net/bug.php?id=43327
2025-06-24 11:55:34 +02:00
Tim Düsterhus
d6fc7430b9 zend_string: Simplify logic in zend_interned_strings_init() (#18922)
No need to manually init a `zend_string` to then intern it, we can directly
intern it while initializing, bypassing some of the safety checks that are
redundant in this case.
2025-06-24 08:50:47 +02:00
Peter Kokot
ecc602e3bb Remove non-existing INI directive detect_unicode (#18909)
The detect_unicode was removed and zend.detect_unicode was added in PHP
5.4 (bbf3d43c1e).
2025-06-23 23:44:20 +02:00
Peter Kokot
29e94f89db Autotools: Remove obsole Autoconf macros (#18914)
These Autoconf macros have been marked as obsolete in PHP-8.4 and now
also removed:
- PHP_AP_EXTRACT_VERSION
- PHP_BUILD_THREAD_SAFE
- PHP_DEF_HAVE
- PHP_OUTPUT
- PHP_TEST_BUILD
2025-06-23 23:43:52 +02:00
Niels Dossche
d8c48903c4 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-14082: Segmentation fault on unknown address 0x600000000018 in ext/opcache/jit/zend_jit.c
2025-06-23 22:29:00 +02:00
Niels Dossche
3664f4a859 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-14082: Segmentation fault on unknown address 0x600000000018 in ext/opcache/jit/zend_jit.c
2025-06-23 22:28:00 +02:00
Niels Dossche
1e3d92f8a9 Fix GH-14082: Segmentation fault on unknown address 0x600000000018 in ext/opcache/jit/zend_jit.c
During persisting, the JIT may trigger and fill in the call graph.
The call graph info is allocated on the arena which will be gone after preloading.
To prevent invalid accesses during normal requests, the arena data should be cleared.
This has to be done after all scripts have been persisted because shared op arrays between
scripts can change the call graph.

Closes GH-18916.
2025-06-23 22:27:36 +02:00
Daniil Gentili
591b3249da Do not use RTLD_DEEPBIND if dlmopen is available (#18612)
DL_LOAD now doesn't use RTLD_DEEPBIND deepbind anymore on platforms
where dlmopen with LM_ID_NEWLM is available:
this means shared library symbol isolation (if needed) must be enabled on
the user side when requiring libphp.so, by using dlmopen with LM_ID_NEWLM
instead of dlopen.
RTLD_DEEPBIND is still enabled when the Apache SAPI is in use.

Closes GH-10670.
2025-06-23 21:44:58 +02:00
Niels Dossche
6eed02bacc Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-18899: JIT function crash when emitting undefined variable warning and opline is not set yet
2025-06-23 20:10:27 +02:00
Niels Dossche
56c4ddfaf6 Fix GH-18899: JIT function crash when emitting undefined variable warning and opline is not set yet
The crash happens because EX(opline) is attempted to be accessed but
it's not set yet.

Closes GH-18904.
2025-06-23 20:10:09 +02:00
Niels Dossche
9b7252b8bd Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-18639: Internal class aliases can break preloading + JIT
2025-06-23 20:01:49 +02:00
Niels Dossche
ee2c0d7e7f Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-18639: Internal class aliases can break preloading + JIT
2025-06-23 20:01:40 +02:00
Niels Dossche
8e731ca622 Fix GH-18639: Internal class aliases can break preloading + JIT
ZEND_FUNC_INFO() can not be used on internal CE's. If preloading makes a
CE that's an alias of an internal class, the invalid access happens when
setting the FUNC_INFO.

While we could check the class type to be of user code, we can just skip
aliases altogether anyway which may be faster.

Closes GH-18915.
2025-06-23 20:01:15 +02:00
Niels Dossche
8493495361 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix misleading errors in printf()
  Unbreak PRINTF_DEBUG macro usages
2025-06-23 19:59:22 +02:00
Niels Dossche
eb78a0b53f Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix misleading errors in printf()
  Unbreak PRINTF_DEBUG macro usages
2025-06-23 19:59:16 +02:00
Niels Dossche
799ec7b8c5 Fix misleading errors in printf()
The precision and width _can_ be zero.

Closes GH-18911.
2025-06-23 19:58:49 +02:00
Niels Dossche
b50898894d Unbreak PRINTF_DEBUG macro usages
Clearly nobody has used this in a while given the compile errors and
warnings.
This patch fixes them so there are no errors nor warnings anymore.

Closes GH-18910.
2025-06-23 19:58:19 +02:00
Ilija Tovilo
ddfa743aba Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix leak when creating cycle in hook
2025-06-23 17:48:36 +02:00
Ilija Tovilo
fe504d3357 Fix leak when creating cycle in hook
This is necessary because the VM frees operands with the nogc variants. We
cannot just call gc_possible_root() because the object may no longer exist at
that point.

Fixes GH-18907
Closes GH-18917
2025-06-23 17:48:07 +02:00
Gina Peter Banyard
c7f0ac1bf9 ext/random: Remove useless tests (#18920) 2025-06-23 13:59:05 +01:00
Gina Peter Banyard
7f80d4dc7d ext/session: Remove bool type coercions in tests 2025-06-23 14:57:13 +02:00
Gina Peter Banyard
4baecc1d4a ext/simplexml: Remove bool type coercions in tests 2025-06-23 14:57:05 +02:00
Gina Peter Banyard
40be5fa99f ext/sockets: Remove bool type coercions in tests 2025-06-23 14:56:53 +02:00
Gina Peter Banyard
4ff8d9f6b4 ext/uri: Remove bool type coercions in tests (#18921) 2025-06-23 13:49:20 +01:00
Gina Peter Banyard
c26105d22e ext/posix: Remove ZPP tests 2025-06-23 14:30:08 +02:00
Gina Peter Banyard
8cd4f95ea3 ext/pcntl: Remove bool type coercions in tests 2025-06-23 14:29:59 +02:00
Gina Peter Banyard
b068bef45d ext/dom: Remove bool type coercions in tests 2025-06-23 14:29:52 +02:00
Gina Peter Banyard
c7778641dd ext/mbstring: Remove ZPP tests 2025-06-23 13:58:31 +02:00
Gina Peter Banyard
c03f6065fa ext/calendar: Remove ZPP test 2025-06-23 13:58:19 +02:00
Gina Peter Banyard
67bbf9c961 ext/filter: Remove ZPP test 2025-06-23 13:58:10 +02:00
David Carlier
0f55c20afd Merge branch 'PHP-8.4' 2025-06-23 11:47:10 +01:00
David Carlier
e3fe9a93c7 Merge branch 'PHP-8.3' into PHP-8.4 2025-06-23 11:46:45 +01:00
David Carlier
2ccd2b016d ext/calendar: jewishtojd overflow on year argument.
Upper limit set to the 7th millenium (Messianic Age) in the jewish calendar,
 around 2239 year in the gregorian calendar.

close GH-18849
2025-06-23 11:46:10 +01:00
Tim Düsterhus
81865ec5bd uri: Improve exceptions for Uri\WhatWg\Url (#18855)
A more specific exception message is used, while the code is simplified.
2025-06-23 12:14:00 +02:00
David Carlier
375316d0e2 ext/sqlite3: Sqlite3Result::fetchAll()
support associative and indexes arrays for results.

close GH-1884
2025-06-23 08:01:31 +01:00
David Carlier
22bd2ae63f ext/sqlite3: explain statement support addition.
similar to what have been done for pdo/sqlite as having statement
explain support to simulate how a query would operate or
for more advanced users, analysing the VM routines used
for possible optimisations.

close GH-18853
2025-06-23 07:57:45 +01:00
Saki Takamachi
e9310171f7 [skip ci] Add myself to EXTENSIONS (#18918) 2025-06-23 15:29:20 +09:00
DanielEScherzer
ddd33fd7e4 Generated arginfo headers: combine preprocessor conditional blocks (2) (#18667)
When global constants' or class constants' availability is based on some
preprocessor condition, the generated arginfo header files wrap the
declarations in the preprocessor `#if` conditional blocks, one per declaration,
even if they are in the same conditional block based on comments in the stub
file. Instead of having multiple conditional blocks one after the other with
the same condition, combine them into a single conditional block.
2025-06-22 14:35:28 -07:00
DanielEScherzer
4dfba7a250 [RFC] Final Property Promotion
https://wiki.php.net/rfc/final_promotion
2025-06-22 12:29:26 -07:00
David CARLIER
01c3001eb7 ext/tidy: zend_parse_parameters_none -> ZEND_PARSE_PARAMETERS_NONE macro (#18913) 2025-06-22 19:47:36 +01:00
Peter Kokot
4f1b005522 Autotools: Enable tsrmls cache in hash extension on big endian (#15303)
When system is detected as big endian this enables the TSRM Local
Storage static cache with the ZEND_ENABLE_STATIC_TSRMLS_CACHE
compilation flag. Previously it was enabled only on little endian
systems.
2025-06-22 16:03:55 +02:00
Peter Kokot
3df665a888 [Windows build] Remove redundant flags definitions (#18890)
The /d2FuncCache1 compile option is already added by
toolset_setup_common_cflags() in confutils.js to all targets.

ZEND_DVAL_TO_LVAL_CAST_OK was removed in
3725717de1.
2025-06-22 15:19:08 +02:00
Niels Dossche
b727821c79 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-18901: integer overflow mb_split
2025-06-22 13:09:09 +02:00
Niels Dossche
2577e3a703 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-18901: integer overflow mb_split
2025-06-22 13:08:05 +02:00