Commit Graph

137957 Commits

Author SHA1 Message Date
Peter Kokot
e358634cdc
Sync Zend/*_i386_sysv_elf_gas.S with upstream (#15788)
This is a sync with upstream already fixed in early 2024 which fixes
64-bit builds on 32-bit hosts. PHP's bundled config.guess sets the
host_alias, for example, on Solaris systems to 64-bit if the compiler
supports it even though the architecture is actually 32-bit. These
assembly files resolve this situation in a build-system-agnostic way by
including the architecture file that is supported by the compiler.
2024-09-07 21:27:02 +02:00
Daniel Ruf
dfe6c13850
Fix typo (#15780)
* Fix typo

* Implement conditional message

* Use suggested code with ternary

* Wrap ternary

Co-authored-by: Peter Kokot <peterkokot@gmail.com>

---------

Co-authored-by: Peter Kokot <peterkokot@gmail.com>
2024-09-07 15:25:02 +02:00
Niels Dossche
ac0931d37a Reuse bcmath_check_scale() 2024-09-07 12:26:59 +02:00
Niels Dossche
2e88916b58 Move bcmath_check_scale() 2024-09-07 12:26:59 +02:00
Niels Dossche
f1b4e1276c Simplify bcmath_check_scale()
The scale is default-initialized to 0, so we can simplify the code a
bit.
2024-09-07 12:26:59 +02:00
Peter Kokot
94ecc1fe7d
Autotools: Sync CS for PHP_PWRITE_TEST and PHP_PREAD_TEST (#15774)
- AS_* macros used
- Arguments quoted
- Cache variable ac_cv_pread renamed to php_cv_func_pread
- Cache variables ac_cv_pwrite renamed to php_cv_func_pwrite
2024-09-07 11:53:35 +02:00
Peter Kokot
de48b90d61
Convert CRLF line endings to LF (#15767)
This patch simplifies line endings tracked in the Git repository and
syncs them to the LF style instead of the CRLF.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git also provides `.gitattributes` file to specify files that need
specific line endings in the working directory on all platforms (either
CRLF or LF):

```
file-with-crlf text eol=crlf
```

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion if core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2024-09-07 11:03:32 +02:00
Peter Kokot
5ea6b044cd
Autotools: Fix gd extension -I flag for bundled libgd (#15786)
The ext_srcdir variable is at time of writing set only after calling the
PHP_NEW_EXTENSION. Other extensions also use @ext_srcdir@ template
placeholder for these cases. This fixes wrongly set include flag even
though build also works without libgd include flag.
2024-09-07 09:46:06 +02:00
DanielEScherzer
4a4574290f
[skip ci] docs: fix constant syntax in stubs.rst (#15785)
Constants are declared with `=` not `:`
2024-09-07 08:22:10 +01:00
DanielEScherzer
047f0c9657
userland_declaration_error_class_const.phpt: fix test name (#15784)
Unlike the `userland_declaration_error_const.phpt` test, the point of this test
is to demonstrate using a class constant as the default parameter. See also the
corresponding internal_declaration_* tests.

[skip ci]
2024-09-07 07:37:05 +02:00
Peter Kokot
56400f709b
Autotools: s/M4 macros/Autoconf macros (#15778)
M4 macros would mean macros for M4 language like m4_normalize() and
similar. Macros defined with AC_DEFUN are better called simply Auotoconf
macros.

[skip ci]
2024-09-07 05:53:00 +02:00
Bob Weinand
25d761623c
Make internal run_time_cache a persistent allocation (#15040)
We also add zend_map_ptr_static, so that we do not incur the overhead of constantly recreating the internal run_time_cache pointers on each request.
This mechanism might be extended for mutable_data of internal classes too.
2024-09-07 01:45:26 +02:00
Derick Rethans
2f3224ea41
Updated to version 2024.2 (2024b) 2024-09-06 12:33:39 +01:00
Derick Rethans
8fcd0ccecf
Empty merge 2024-09-06 12:33:38 +01:00
Derick Rethans
7023fb9d93
Updated to version 2024.2 (2024b) 2024-09-06 12:33:37 +01:00
Derick Rethans
d31a9474b0
Empty merge 2024-09-06 12:33:37 +01:00
Derick Rethans
5fc37b1ec6
Updated to version 2024.2 (2024b) 2024-09-06 12:33:36 +01:00
Peter Kokot
e0e6d326e2
Autotools: Sync CS in PHP_PROG_AWK (#15772)
- AS_* macros used
2024-09-06 12:10:50 +02:00
Peter Kokot
418329226a
Autotools: Sync CS in php.m4 (#15771)
- AS_* macros used
2024-09-06 09:31:52 +02:00
Peter Kokot
bcbf7bea92
Autotools: Replace uname with host_alias for finding Solaris (#15770)
This wraps checks in AC_CACHE_CHECK and replaces the "uname -sr" command
with simpler $host_alias as it is already set by the config.guess script
properly.
2024-09-06 08:44:10 +02:00
Peter Kokot
824f55ae84
Sync Zend/asm/make_ppc64_sysv_macho_gas.S with upstream (#15769)
There was a typo in make_ppc64_sysv_macho_gas.S with missing closing
multi-line comment. Upstream fixed it in ~2023:
https://github.com/boostorg/context/
2024-09-06 08:42:44 +02:00
Peter Kokot
aebe63dd0f
Autotools: Sync CS for PHP_RUNPATH_SWITCH (#15768)
- AS_VAR_IF macros used
- AC_CACHE_VAL and AC_MSG_CHECKING replaced with AC_CACHE_CHECK
- arguments quoted
2024-09-06 08:41:09 +02:00
DanielEScherzer
f17c220388
[skip ci] Zend/tests/return_types/never_generator.phpt: fix test name (GH-15757)
The test is unrelated to parameter types, likely left over from a copy-paste
with never_parameter.phpt
2024-09-05 19:26:26 +02:00
DanielEScherzer
e1f7197f89
[skip ci] zend_compile.h: ZEND_ACC_FINAL can be used for constants (GH-15764)
There was a whole RFC about this, but the implementation in #6878 seems to have
missed updating the documentation
2024-09-05 19:22:07 +02:00
Christoph M. Becker
6732b8892d
Support --openssl-legacy-providers on Windows, too (GH-15747)
This is not necessarily useful for Windows (few use custom builds on
that platform), but for feature parity with other platforms it seems
reasonable to support it on Windows.

We make sure, though, that the feature is not enabled for snapshot
builds by adding the option to the build exclusions.
2024-09-05 10:49:16 +02:00
Peter Kokot
438b781a80
Update skeleton extension .gitignore (#15738)
This adds:

- config.cache produced by: ./configure -C
- config.nice.bat, configure.js and configure.bat on Windows when using
  phpize

[skip ci]
2024-09-05 07:14:29 +02:00
Daniel Scherzer
29f9f903b1
backporting GH-15755 fix. 2024-09-05 02:02:36 +01:00
David Carlier
1e62d203a6
Merge branch 'PHP-8.3' 2024-09-05 01:55:58 +01:00
David Carlier
ea83eba590
Merge branch 'PHP-8.2' into PHP-8.3 2024-09-05 01:41:55 +01:00
Daniel Scherzer
c5e0a6aaab
Fix GH-15752: finfo_file() - parameter validation error messages
Show the correct parameter names and numbers - the errors are caused by the
second parameter being empty or having null bytes, not the first.

close GH-15755
2024-09-05 01:41:15 +01:00
DanielEScherzer
9b7dac4532
[skip ci] update NEWS for GH-15731 (#15756) 2024-09-05 00:26:31 +01:00
DanielEScherzer
5a18279b5d
Fix GH-15731: Prevent #[AllowDynamicProperties] on enums (#15733) 2024-09-04 23:56:18 +01:00
Levi Morrison
6435bb5ae1
Interrupt while internal frame is on the stack (#14627)
* Check VM interrupt while internal frame is on top

* Use tab instead of spaces

* fix frame used in interrupt and refactor

* remove unused failures for zend_jit_check_timeout

* Fix JIT support

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>

* Fix the missing store to vm_interrupt

* Rename new functions

* Special case zend_interrupt_function in JIT code

* refactor to use ZEND_VM_SET_OPCODE_NO_INTERRUPT

* Split atomic exchange into load + store

It is difficult to determine performance of atomics sometimes. In this
case, the separate load+store is still correct, and a load does not
cause a modification, and might be faster for some platforms than an
exchange. A load+store is slower than an exchange, but we're fine
trading the penalty to the slow path and keeping the happy path faster.

---------

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
2024-09-05 00:35:55 +02:00
Peter Kokot
816aea797b
Autotools: Mark always-shared extensions with ext_shared variable (#15739)
This makes future config.m4 files changes simpler in case of adding
additional checks, macro calls etc. Or if these extensions configuration
would change at some point.
2024-09-04 23:28:29 +02:00
Peter Kokot
035b0c50bc
Autotools: Sync CS in PHP_EVAL_LIBLINE (#15737)
- AS_* macros used
- arguments quoted
- redundant quotation of variable-variable simplified from [$]$2 to $$2
  (see Autoconf documentation)
2024-09-04 23:27:20 +02:00
Peter Kokot
6cd0e50845
Autotools: Document the EXTENSION_DIR environment variable (#15743) 2024-09-04 23:25:50 +02:00
DanielEScherzer
f9d01e46fe
#[AllowDynamicProperties] validation: improve error messages (#15734)
For traits and interfaces, include the name of the relevant trait (or
interface) in the error message, the same way it is included for readonly
classes.
2024-09-04 22:54:42 +02:00
Christoph M. Becker
1d36927127
Support SHA256_Transform_shani() with MSVC, too
Closes GH-15312.
2024-09-04 18:07:59 +02:00
Christoph M. Becker
5d1181fb3f
Fix GH-15742: php_hash_sha.h incompatible with C++
Not only MSVC doesn't support this construct, but apparently it is
generally not supported by C++ compilers.

Closes GH-15745.
2024-09-04 17:25:43 +02:00
DanielEScherzer
d552fbd9f7
zend_get_constant_ex() - remove commented out handling of class constants (#15728)
Was factored out into a dedicated method, `zend_get_class_constant_ex()`, back
in 2021 (4dcde9cf18) but instead of removing the
old logic it was just commented out. If it hasn't been needed since 2021, it
should be safe to remove.
2024-09-04 16:15:27 +02:00
Christoph M. Becker
217ea732fc
Use php_error_docref() instead of zend_error() in session.c (GH-15505)
Using `php_error_docref()` is preferable since it outputs additional
details (which function has been called and whether it is a startup or
shutdown error), uses HTML markup, and also provides a link to the
documentation, if configured.

Since these deprecation warnings have been introduced recently[1][2],
i.e. for PHP 8.4, there are no BC concerns.

[1] <e8ff7c70f9>
[2] <b36eac94d2>

Co-authored-by: Máté Kocsis <kocsismate90@gmail.com>
2024-09-04 16:00:28 +02:00
DanielEScherzer
5dd0575698
Generated arginfo header files: combine preprocessor conditional blocks (#15736)
When functions' or class methods' 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.
2024-09-04 13:04:22 +02:00
Ayesh Karunaratne
24d4ae9d2f
ext/curl: No-op CURLOPT_DNS_USE_GLOBAL_CACHE constant (GH-15127)
Libcurl `CURLOPT_DNS_USE_GLOBAL_CACHE` constant is no longer supported
since libcurl[^1] 7.62. This no-ops the constant, but without causing
any deprecation notices.

[^1]: [CURLOPT_DNS_USE_GLOBAL_CACHE](https://curl.se/libcurl/c/CURLOPT_DNS_USE_GLOBAL_CACHE.html)
2024-09-04 12:40:45 +02:00
Saki Takamachi
fad899e566
[RFC] Support object types in BCMath (#13741)
Added BcMath\Number class. It is an immutable object, has methods that are
equivalent to existing BCMath calculation functions, and can also be calculated
using operators.

The existing BCMath function returned a string for each calculation, but this
class returns an object.

RFC: https://wiki.php.net/rfc/support_object_type_in_bcmath,
https://wiki.php.net/rfc/fix_up_bcmath_number_class

---------

Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2024-09-04 11:12:51 +09:00
Peter Kokot
13f041163c
Remove Travis artefacts (#15714)
Travis was suspended https://github.com/php/php-src/pull/15314

This removes 404 errored Travis image in README, travis configuration
directory and YAML file and usages in tests.

[skip ci]

Co-authored-by: Gina Peter Banyard <girgias@php.net>
2024-09-04 01:15:10 +02:00
Peter Kokot
9a9e178328
Autotools: Enhance appending -lrt (#15719)
If the opcache extension would be built statically one day this also
takes care of this to make the check more ubiquitous.
2024-09-04 00:43:21 +02:00
DanielEScherzer
53cb89670c
Generated arginfo header files: remove empty zend_function_entry arrays (#15705)
When a class (or enum) has no methods, rather than using an array that only
contains `ZEND_FE_END`, use `NULL` for the functions. The implementation of
class registration for internal classes, `do_register_internal_class()` in
zend_API.c, already skips classes where the functions are `NULL`. By removing
these unneeded arrays, we can reduce the size of the header files, while also
removing an unneeded call to zend_register_functions() for each internal class
with no extra methods.
2024-09-03 23:19:53 +02:00
Máté Kocsis
7dfbf4d1b7
Merge branch 'PHP-8.3'
* PHP-8.3:
  Add missing return for DatePeriod::__unserialize
2024-09-03 21:32:03 +02:00
Máté Kocsis
1663ed6c6e
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add missing return for DatePeriod::__unserialize
2024-09-03 21:31:00 +02:00
Máté Kocsis
6cab76986d
Add missing return for DatePeriod::__unserialize
Additionally, add other RETURN_THROWS() defensively.
2024-09-03 21:27:50 +02:00