Commit Graph

19304 Commits

Author SHA1 Message Date
Ilija Tovilo
daeb3295b2
Improve readonly avis error (GH-15618)
We don't track whether protected(set) is implicit, so for now always point out
when the property is readonly in the error message.
2024-08-29 13:19:31 +02:00
Arnaud Le Blanc
bf96980104
Merge branch 'PHP-8.3'
* PHP-8.3:
  [ci skip] NEWS for GH-15330
  [ci skip] NEWS for GH-15330
  Do not scan generator frames more than once (#15330)
2024-08-28 17:45:49 +02:00
Arnaud Le Blanc
f551a719dc
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS for GH-15330
  Do not scan generator frames more than once (#15330)
2024-08-28 17:44:41 +02:00
Arnaud Le Blanc
cd25500766
Do not scan generator frames more than once (#15330) 2024-08-28 17:43:17 +02:00
Arnaud Le Blanc
5b482b706e
Alpine/Musl nightly job (#13925)
Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz>
2024-08-28 17:28:07 +02:00
DanielEScherzer
a7695d146a
[skip ci] Zend/tests/assert/expect_015.phpt: fix typo in test name (GH-15609)
`peinter` -> `printer`
2024-08-28 11:30:02 +02:00
Ilija Tovilo
8df557ac42
[RFC] Asymmetric visibility v2 (GH-15063)
Co-authored-by: Larry Garfield <larry@garfieldtech.com>
2024-08-27 02:04:48 +02:00
Niels Dossche
baac01f594 Improve virtual property error message
Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
2024-08-26 21:17:49 +02:00
Ilija Tovilo
b839c5f1af
Fix building of callgraph including preloaded symbols (GH-15545)
This issue was introduced in GH-15021. When building the call graph, we can now
see preloaded functions. However, building the call graph involves adding the
function to the caller list of the callee, which we don't want to do for
functions not coming from the script.

Fixes GH-15490
2024-08-26 17:22:04 +02:00
Máté Kocsis
8d12f666ae
Fix registration of internal readonly child classes (#15459)
Currently, internal classes are registered with the following code:

INIT_CLASS_ENTRY(ce, "InternalClass", class_InternalClass_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
class_entry->ce_flags |= ...;

This has worked well so far, except if InternalClass is readonly. It is because some inheritance checks are run by zend_register_internal_class_ex before ZEND_ACC_READONLY_CLASS is added to ce_flags.

The issue is fixed by adding a zend_register_internal_class_with_flags() zend API function that stubs can use from now on. This function makes sure to add the flags before running any checks. Since the new API is not available in lower PHP versions, gen_stub.php has to keep support for the existing API for PHP 8.3 and below.
2024-08-24 12:36:54 +02:00
Peter Kokot
062e9f9134
Remove unused buffer variables (#15550)
These emit warning: unused variable 'buffer'.
2024-08-23 16:40:19 +02:00
Gina Peter Banyard
d9695401e4
Zend: Voidify virtual_cwd_(de)activate() (#15554)
It always returned 0
2024-08-23 15:28:37 +01:00
Ilija Tovilo
8fcf34d598
Remove ZEND_ACC_ABSTRACT from prop variance check
Abstract properties are now virtual, unless they actually contain concrete hook
implementations using the backing field.
2024-08-23 16:13:23 +02:00
Peter Kokot
f952263bcd
Fix Solaris 10 build: missing libproc.h (#15525)
The libproc.h header file was added on Solaris as of 11.4.

* Also add guard check to the entire function
* When libproc.h isn't available also sys/procfs.h is redundant
* Move the <sys/lwp.h> out of the guard
* Exclude more stuff from Solaris 10
2024-08-22 20:26:44 +02:00
Peter Kokot
6b809c8890
Autotools: Fix stack direction check (#15528)
On Solaris 10 and GCC 4.9 check failed with error in config.log:
error: missing binary operator before token "("

The __has_builtin must be checked in its own `#ifdef/defined` line
above the `#if __has_builtin(....` usage.
2024-08-21 22:50:11 +02:00
Gina Peter Bnayard
5853cdb73d Use "must not" instead of "cannot" wording 2024-08-21 21:12:17 +01:00
Gina Peter Bnayard
96d572a18e Zend: Add helper for "cannot be empty" ValueError 2024-08-21 21:12:17 +01:00
Ilija Tovilo
327588abf9
Replace OBJ_PROP_PTR_TO_NUM() with zend_get_property_info_for_slot()
I wasn't aware such a function already existed.
2024-08-20 18:44:42 +02:00
Christoph M. Becker
c9ea4d76af
Revert "Merge branch 'PHP-8.3'"
This reverts commit a2313cea5a, reversing
changes made to 588029a989.
2024-08-20 16:34:52 +02:00
Christoph M. Becker
a2313cea5a
Merge branch 'PHP-8.3'
* PHP-8.3:
  zend_max_execution_timer: fix gcc compatibility (#15447)
2024-08-20 16:31:55 +02:00
Go Kudo
89daa8354f
zend_max_execution_timer: fix gcc compatibility (#15447) 2024-08-20 16:28:03 +02:00
Christoph M. Becker
b75775ea39
Revert "Merge branch 'PHP-8.3'"
This reverts commit b363a606a4, reversing
changes made to 3ed5eee5d3.
2024-08-20 16:09:46 +02:00
Christoph M. Becker
b363a606a4
Merge branch 'PHP-8.3'
* PHP-8.3:
2024-08-20 15:38:34 +02:00
Ilija Tovilo
b6d7c011b8
Fix virtual properties in get_class_vars() (GH-15494)
Fixes GH-15456
2024-08-19 17:39:31 +02:00
Ilija Tovilo
60f87f29bb
Fix various hooked object iterator issues (GH-15394)
Fixes GH-15187
2024-08-19 15:46:20 +02:00
Ilija Tovilo
36b1977415
Fix missing compile error when declaring hooked props on readonly classes (GH-15439)
Fixes GH-15419
2024-08-19 14:58:55 +02:00
Ilija Tovilo
770616b823
Fix param with hooks but no visibility not treated as cpp (GH-15442)
Fixes GH-15438
2024-08-19 14:53:54 +02:00
Christoph M. Becker
f16cb1866a
Fix ZEND_FASTCALL definition wrt. x64 Windows clang builds (GH-15425)
As is, MSVC uses `__vectorcall`, but clang uses `__cdecl`.  This
obviously is bad for interoperability (and causes link issues), and is
likely worse for FFI which offers some limited (but likely sufficient
for our purposes) support for `__vectorcall` on Windows.

Since clang claims to support `__vectorcall` as of 3.6.0, and we bumped
the requirements to clang 4.0.0 already, there shouldn't be any issues.
2024-08-18 12:20:09 +02:00
Juliette
4c5767f62f
PHP 8.4 | Exit as function: fix incorrect parameter name (#15433)
Follow up on 13483

As previously reported in https://github.com/php/php-src/pull/13483#discussion_r1718546927:

> The parameter names seem to be incorrect.
>
> It should be `$status`, not `$code`.
>
> The RFC explicitly uses that parameter name in the proposal: https://wiki.php.net/rfc/exit-as-function#proposal
>
> It is also the name already used in the [manual](https://www.php.net/exit).
>
> Lastly, the parameter name `$status` better covers what can be passed: either a status _message_ or a status _code_.
> While `$code` would read pretty weird when passing a message:
> ```php
> exit(code: 'message');
> ```

This commit attempts to fix this.

Includes adding a test for exit/die using a named argument.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2024-08-16 22:35:16 +01:00
Go Kudo
05d92db5e5 Merge branch 'PHP-8.3' 2024-08-16 20:23:14 +00:00
Go Kudo
d87fd356dc Merge branch 'PHP-8.2' into PHP-8.3
# Conflicts:
#	NEWS
2024-08-16 20:21:51 +00:00
Go Kudo
836e6fa900
zend_max_execution_timer: fix gcc compatibility (#15447) 2024-08-17 05:20:04 +09:00
Go Kudo
9168b18c84 Merge branch 'PHP-8.3' 2024-08-17 02:57:12 +09:00
Go Kudo
6140f9a6f7 Merge branch 'PHP-8.2' into PHP-8.3 2024-08-17 02:54:38 +09:00
Go Kudo
ec9cdcd2bc
Fix MSan false-positive in zend_max_execution_timer (#15408)
Explicitly mark memory regions as unpoisoned for zend_max_execution_timer on ZTS, as MemorySanitizer in clang >= 18 causes false positives.
2024-08-17 02:54:03 +09:00
Remi Collet
a6b7f134a9
exit_as_funtion RFC follow-up: ensure default INI settings used in status test (#15420) 2024-08-15 11:13:32 +01:00
Gina Peter Bnayard
4a4aae540b Zend/zend_object_handlers.c: Remove unused include 2024-08-15 00:08:19 +02:00
Gina Peter Banyard
a79c70f574
[RFC] Convert exit (and die) from language constructs to functions (#13483)
RFC: https://wiki.php.net/rfc/exit-as-function
2024-08-14 12:44:12 +01:00
Jakub Zelenka
0b61b8dc99
PHP-8.3 is now for PHP-8.3.12-dev 2024-08-13 20:16:40 +01:00
Christoph M. Becker
65c6d72319
Drop FASTCALL on variadic functions (GH-15389)
This is unlikely to be properly supported by compilers anyway, see
<https://github.com/php/php-src/pull/2975>.
2024-08-13 19:46:48 +02:00
Sergey Panteleev
84d8fa9f53
PHP-8.2 is now for PHP 8.2.24-dev 2024-08-13 17:18:16 +03:00
Ilija Tovilo
be6dee3c5d
Reset seen symbols when ending namespace (GH-15244)
Previously, seen symbols were never cleaned during the compilation of a single
file. This makes it impossible to use a class or function from a different
namespace if such a symbol is also declared within the same file. This is
inconsistent with how it would work when split into different files.
2024-08-13 15:47:14 +02:00
Gina Peter Bnayard
5622def429 Add more tests covering deprecation of _ as CE name 2024-08-13 14:37:40 +02:00
Ilija Tovilo
a4772a0c47
[skip ci] Remove unclosed vim code folding 2024-08-12 18:50:38 +02:00
Gina Peter Banyard
0a23b0678d
Deprecate using "_" as a class name (#15360)
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_using_a_single_underscore_as_a_class_name
2024-08-12 16:10:30 +01:00
Arnaud Le Blanc
c02c1d4474
Change YIELD/YIELD_FROM to do not increment opline (#15328)
YIELD and YIELD_FROM increment opline before returning, but in most places
we need the opline to point to the YIELD and YIELD_FROM.

Here I change YIELD / YIELD_FROM to not increment opline. This simplifies the
code and fixes GH-15275 in a better way.

Closes GH-15328
2024-08-10 16:09:47 +02:00
Arnaud Le Blanc
b43dd10bbb
Merge branch 'PHP-8.3'
* PHP-8.3:
  [ci skip] NEWS for GH-15275
  [ci skip] NEWS for GH-15275
  Fix crash during GC of suspended generator delegate (#15275)
2024-08-10 16:08:19 +02:00
Arnaud Le Blanc
ba9f65bacd
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS for GH-15275
  Fix crash during GC of suspended generator delegate (#15275)
2024-08-10 15:48:43 +02:00
Arnaud Le Blanc
c767fec2d0
Fix crash during GC of suspended generator delegate (#15275) 2024-08-10 15:46:31 +02:00
Ilija Tovilo
5c739acb2a
[skip ci] Mark stack limit tests with high memory limit as slow 2024-08-09 20:29:58 +02:00
Niels Dossche
00001c4a0c
Fix GH-15292: Dynamic AVX detection is broken for MSVC
See https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170
For x64, either _M_X64 or _M_AMD64 would work but I'm going with what's
already used in php-src.

Closes GH-15301.
2024-08-09 18:11:46 +02:00
Gina Peter Banyard
1e3d918936
ext/core: Deprecate passing E_USER_ERROR to trigger_error() (#15308)
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_passing_e_user_error_to_trigger_error
2024-08-09 15:51:07 +01:00
Peter Kokot
d7a8a04eb9
Autotools: Remove too basic optimization flag cleanup
The optimization flags are removed in configure.ac when using the
'--enable-debug' configure option (which also adds the '-O0'). When
using '--enable-debug-assertions' option, the optimization flags ideally
shouldn't be removed and this case never actually happen because the
CFLAGS at this point in ZEND_INIT contain all sorts of other flags also,
so it's redundant as it never gets executed.

Closes GH-15305
2024-08-09 13:56:08 +02:00
Ilija Tovilo
46ee0fb304
Disallow indirect modification on readonly properties within __clone() (#15012)
Indirect modification isn't allowed in __construct() because it allows
references to leak, so it doesn't make much sense to allow it in __clone().
2024-08-09 11:56:16 +02:00
Peter Kokot
5c870751f2
Autotools: Sync CS in Zend.m4 (#15304)
- Autoconf sets the GCC variable to either "yes" if GNU C compatible
  compiler is detected (like gcc or clang) or to an empty value
  otherwise.
- AX_CHECK_COMPILE_FLAG arguments quoted and empty arguments trimmed
2024-08-09 01:38:42 +02:00
Peter Kokot
02e22a5d09
Autotools: Remove DEBUG_CFLAGS (#15300)
DEBUG_CFLAGS is at this point redundant variable.
2024-08-09 01:21:44 +02:00
Gina Peter Banyard
25b4696530
ext/xml: Deprecate xml_set_object() and passing non-callable strings as handlers (#15293) 2024-08-08 23:37:49 +01:00
Tim Düsterhus
6eca7839af
hash: Add SHA-NI implementation of SHA-256 (#15152)
* hash: Add SSE2 implementation of SHA-256

Implementation taken from
tarsnap/libcperciva@661752aee8.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>

* zend_cpuinfo: Add ZEND_CPU_FEATURE_SHA

* hash: Add SHA-NI implementation of SHA-256

Implementation taken from
tarsnap/libcperciva@661752aee8.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

* NEWS / UPGRADING

---------

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2024-08-08 22:19:33 +02:00
Christoph M. Becker
2190353b08
Merge branch 'PHP-8.3'
* PHP-8.3:
  zend_enum: Rename try parameter to avoid conflict with C++
2024-08-07 14:56:19 +02:00
Christoph M. Becker
aa709dc05b
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  zend_enum: Rename try parameter to avoid conflict with C++
2024-08-07 14:55:14 +02:00
Christoph M. Becker
423fc811bd
zend_enum: Rename try parameter to avoid conflict with C++
`try` is a keyword in C++, and as such C++ code including <zend_enum.h>
fails to compile unless a workaround is in place.  To resolve this, we
simply rename the parameter.

We choose `try_from` to make it clear that this parameter is true when
the function is called from `BackedEnum::tryFrom()`.  For consistency,
we also rename the `try` parameter of `zend_enum_from_base()`, although
that function is not exported.

This issue had been reported by @oplanre, who also provided an initial
PR.

Closes GH-15259.
2024-08-07 14:54:35 +02:00
Christoph M. Becker
af8ef4c5b0
Update Windows CI to build with vs17
PHP 8.4 is supposed to be built with vs17 (aka. Visual Studio 2022)[1],
so we also do this for CI.

We mark gh8841.phpt as xfail for known reasons.

[1] <https://windows.php.net/>
2024-08-06 17:19:08 +02:00
Gina Peter Banyard
bc8909aac3
Zend: Add test disabling assert() function 2024-08-06 13:21:18 +01:00
Peter Kokot
62f75a7812
Autotools: Refactor thread safety checks (#15214)
- The ZTS is defined on only one place
- Added help text for ZTS preprocessor macro
- The 'enable_zts' variable replaced with PHP_THREAD_SAFETY in
  configure.ac.
- Nits fixed.
2024-08-05 22:30:10 +02:00
Ilija Tovilo
2f27e0b2ab
Fix missing variance check for abstract set with asymmetric type (#15157)
Fixes GH-15140
2024-08-05 16:43:54 +02:00
Ilija Tovilo
5d9c155dd3
Fix inheritance of hooks onto plain properties 2024-08-05 14:30:37 +02:00
Ilija Tovilo
43f688e1ed
Fix zend_function.prop_info pointer for trait hooks (#15245)
Fixes GH-15240
2024-08-05 13:14:37 +02:00
Ilija Tovilo
50217b35ea
Remove IS_STATIC_VAR_UNINITIALIZED (#15227)
This flag was never necessary. We know a static variable is uninitialized (i.e.
the initializer has never been called) iff the zval in the static variable array
does not contain a reference.

Prompted by a related issue in ext-uopz reported by Christoph.
2024-08-05 11:19:13 +02:00
Peter Kokot
18a99a4d33
Autotools: Refactor debug checks (#15215)
- Added help text for ZEND_DEBUG preprocessor macro
- CS synced
2024-08-04 21:59:58 +02:00
Peter Kokot
d6a75e19d1
Sync preprocessor macros help texts (#15218)
This partially syncs help texts a bit further for:
- ext/ffi
- ext/ldap
- ext/opcache
- ext/pcre
- ext/pdo_mysql
- ext/readline
- ext/standard
2024-08-04 12:52:16 +02:00
Peter Kokot
dcdcb3cbfe
Autotools: Replace AC_MSG_ERROR with AC_MSG_FAILURE (#15209)
This replaces the AC_MSG_ERROR with AC_MSG_FAILURE, where appropriate.

The AC_MSG_ERROR outputs given message and exits the configure step. The
AC_MSG_FAILURE does the same but also automatically outputs additional
message "See 'config.log' for more details." which might help directing
the user where to look further.

The AC_MSG_ERROR is used for errors where current test step isn't logged
in the config.log and wouldn't make sense, and AC_MSG_FAILURE is mostly
used in cases of library checks, compilation tests, headers checked with
AC_CHECK_HEADER* and similar tests that are also logged in the
config.log.

AC_MSG_ERROR([Sanity check failed.]) output:

```
configure: error: Sanity check failed.
```

AC_MSG_FAILURE([Sanity check failed.]) output:

```
configure: error: in '/path/to/php-src':
configure: error: Sanity check failed.
See 'config.log' for more details
```
2024-08-04 07:36:37 +02:00
Ilija Tovilo
2e9cc9bc30
Allow optimizer to depend on preloaded symbols (#15021)
* Allow optimizer to depend on preloaded symbols

It is safe for the optimizer to rely on preloaded symbols. This can occur when
compiling non-preloaded files, referencing preloaded ones.

* Disable inline pass for observer test

* Move duplicated code into functions

* Add comment to specific optimization value

* Optimizer should only rely on preloaded symbols in the symbol table

* Fix skipif for windows
2024-08-02 17:35:27 +02:00
Arnaud Le Blanc
03149ef962
Merge branch 'PHP-8.3'
* PHP-8.3:
  [ci skip] NEWS
  [ci skip] NEWS
  Fix destruction of generator running in fibers during shutdown (#15158)
2024-07-30 14:59:24 +02:00
Arnaud Le Blanc
e24101acb4
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS
  Fix destruction of generator running in fibers during shutdown (#15158)
2024-07-30 14:56:28 +02:00
Arnaud Le Blanc
99e0d3fe09
Fix destruction of generator running in fibers during shutdown (#15158)
The destructor of generators is a no-op when the generator is running in a fiber,
because the fiber may resume the generator. Normally the destructor
is not called in this case, but this can happen during shutdown.

We detect that a generator is running in a fiber with the
ZEND_GENERATOR_IN_FIBER flag.

This change fixes two cases not handled by this mechanism:

- The ZEND_GENERATOR_IN_FIBER flag was not added when resuming a "yield from $nonGenerator"

- When a generator that is running in a fiber has multiple children (aka multiple generators yielding from it), all of them could be considered to also run in a fiber (only one actually is), and could leak if not destroyed before shutdown.
2024-07-30 14:53:19 +02:00
Christoph M. Becker
ab449a7e46
Add missing cstddef include for C++ builds
Closes GH-15096.
2024-07-25 14:33:03 +02:00
Ilija Tovilo
a0a8624346
Fix throw in IS_IDENTICAL in JIT (#15103)
We need to persist opline in case zend_is_identical() throws.
2024-07-25 13:18:47 +02:00
Dmitry Stogov
8e93eb2e79
Merge branch 'PHP-8.3'
* PHP-8.3:
  Workaraound against false positive GCC array bounds error (#15078)
2024-07-24 08:21:48 +03:00
Dmitry Stogov
1511172b1b
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Workaraound against false positive GCC array bounds error (#15078)
2024-07-24 08:21:37 +03:00
Dmitry Stogov
d41e97ae66
Workaraound against false positive GCC array bounds error (#15078)
This prevents compilation error when compiling PHP by GCC with "-O2 -g -Wall -Werror"

zend_API.c:2754:34: error: array subscript ‘zend_function
{aka const union _zend_function}[0]’ is partly outside array bounds of
‘unsigned char[160]’ [-Werror=array-bounds=]

 2754 |         if (ZSTR_VAL(fptr->common.function_name)[0] != '_'
2024-07-24 08:21:16 +03:00
Arnaud Le Blanc
f4eb81d70e
Followup GH-14996 (#15062) 2024-07-22 19:16:29 +02:00
Bob Weinand
e406ec81f4 Merge branch 'PHP-8.3' 2024-07-22 18:32:04 +02:00
Bob Weinand
61b455b59c Merge branch 'PHP-8.2' into PHP-8.3 2024-07-22 18:30:10 +02:00
Bob Weinand
a18df90a8b Fix GH-13817: Segmentation fault for enabled observers after pass 4
Instead of fixing up temporaries count in between observer steps, just apply the additional temporary in the two affected observer steps.

Closes GH-14018.
2024-07-22 18:28:03 +02:00
Ilija Tovilo
82479e89d0
Throw error for recursive comparison, instead of fatal (#14989)
I don't understand the rationale of fatal erroring here. It seems this should
properly unprotect the compared elements when returning up the stack.

Related to GH-14980
2024-07-22 15:53:41 +02:00
Saki Takamachi
8a4a30469a
Zend: Add ZEND_BYTES_SWAP32/ZEND_BYTES_SWAP64 (#14910) 2024-07-22 17:57:16 +09:00
Peter Kokot
97afc86437
Autotools: Quote M4 arguments (#15045)
- AC_MSG_CHECKING
- AC_MSG_RESULT
- AC_MSG_WARN
- AC_MSG_ERROR
- AC_MSG_NOTICE
2024-07-21 01:52:17 +02:00
Niels Dossche
442ae96444
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15028: Memory leak in ext/phar/stream.c
  Fix GH-15023: Memory leak in Zend/zend_ini.c
  Fix GH-15020: Memory leak in Zend/Optimizer/escape_analysis.c
2024-07-19 14:59:57 +02:00
Niels Dossche
f21947a7ae
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15028: Memory leak in ext/phar/stream.c
  Fix GH-15023: Memory leak in Zend/zend_ini.c
  Fix GH-15020: Memory leak in Zend/Optimizer/escape_analysis.c
2024-07-19 14:59:44 +02:00
Niels Dossche
8c19efdc97
Fix GH-15023: Memory leak in Zend/zend_ini.c
Closes GH-15024.
2024-07-19 14:57:19 +02:00
Niels Dossche
03d73182d9
Fix GH-15020: Memory leak in Zend/Optimizer/escape_analysis.c
Closes GH-15022.
2024-07-19 14:56:28 +02:00
Arnaud Le Blanc
1fbb666545
Use zend_std_build_properties() to access zend_object.properties
The zend_object.properties HashTable needs to be built just in time by calling
rebuild_object_properties() on the object before accessing it. Normally this is
done automatically in zend_std_get_properties(), but we do it manually in a few
places.

In this change I introduce an inline variant of zend_std_build_properties(), and
refactor these places to use it instead of calling rebuild_object_properties()
manually.

rebuild_object_properties() renamed as rebuild_object_properties_internal(), to
enforce usage of zend_std_get_properties() or zend_std_build_properties_ex().

Closes GH-14996
2024-07-18 22:18:38 +02:00
Peter Kokot
b9e1ea33b9
[skip ci] Trim trailing whitespace in *.m4 2024-07-18 22:11:13 +02:00
David CARLIER
8d597150ee
zend build making sigjmp_buf and api check as mandatory. (#14942)
* zend build making sigjmp_buf and api check as mandatory.

all unixes support it since long time, the few which don't do not meet
the requirements to build php anyway (minix, dietlibc, ...).
2024-07-17 22:18:35 +01:00
Ilija Tovilo
ead679ecf8
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix comments between -> and keyword
2024-07-16 23:41:07 +02:00
Ilija Tovilo
e01e2bb5fd
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix comments between -> and keyword
2024-07-16 23:40:59 +02:00
Ilija Tovilo
b368db204f
Fix comments between -> and keyword
Comments should not fall out of ST_LOOKING_FOR_PROPERTY.

Fixes GH-14961
Closes GH-14976
2024-07-16 23:40:18 +02:00
Ilija Tovilo
fdbe910b3b
Fix indirect readonly error messages (#14979)
$obj->ro[] = 42;, passByRef($obj->ro); and the likes should emit an indirect
modification error message. This message already existed but was used
inconsistently.
2024-07-16 23:24:07 +02:00
Pierrick Charron
e07813ad46
PHP-8.2 is now for PHP 8.2.23-dev 2024-07-16 12:20:55 -04:00
Ilija Tovilo
a26ec58fa1
De-duplicate readonly property modification error message (#14972) 2024-07-16 16:29:40 +02:00