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.
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.
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.
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]
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]
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.
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.
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/
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.
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
* 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>
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.
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.
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.
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>
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.
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)
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>
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>
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.