Commit graph

19462 commits

Author SHA1 Message Date
Ilija Tovilo
dbcdd4e4a7
Merge branch 'PHP-8.4'
* PHP-8.4:
  Postpone zend_array_sort() in ext-intl
  Use bool for zend_array_sort()
2024-11-04 16:02:47 +01:00
Ilija Tovilo
085c151481
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Postpone zend_array_sort() in ext-intl
  Use bool for zend_array_sort()
2024-11-04 16:02:31 +01:00
Ilija Tovilo
745684290e
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Postpone zend_array_sort() in ext-intl
  Use bool for zend_array_sort()
2024-11-04 16:02:16 +01:00
Ilija Tovilo
4b9e59b430
[skip ci] Use bool for zend_array_sort()
zend_bool is removed in higher branches.
2024-11-04 15:59:18 +01:00
Ilija Tovilo
ecb87ca5f1
Mark new zend_array_sort_ex() as ZEND_API 2024-11-04 15:53:51 +01:00
Ilija Tovilo
d82fa6adf6
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix array going away during sorting
2024-11-04 15:53:03 +01:00
Ilija Tovilo
230defc198
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix array going away during sorting
2024-11-04 15:51:24 +01:00
Ilija Tovilo
f033cf75e4
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix array going away during sorting
2024-11-04 15:51:03 +01:00
Ilija Tovilo
2bdce61390
Fix array going away during sorting
Fixes GH-16648
Closes GH-16654
2024-11-04 15:50:35 +01:00
Christoph M. Becker
063de1fbdf
Merge branch 'PHP-8.4'
* PHP-8.4:
  Properly initialize _override executor globals
2024-10-31 23:41:28 +01:00
Christoph M. Becker
1fa8187c7b
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Properly initialize _override executor globals
2024-10-31 23:40:48 +01:00
Christoph M. Becker
3cc43bf0e6
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Properly initialize _override executor globals
2024-10-31 23:39:40 +01:00
Christoph M. Becker
ec68d3c608
Properly initialize _override executor globals
These have been introduced a while ago[1], but their initialization has
been overlooked.  Since we cannot rely on TLS variables to be zeroed,
we catch up on this.

[1] <e3ef7bbbb8>

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>

Closes GH-16658.
2024-10-31 23:38:01 +01:00
Daniel Scherzer
f5e743a520
Add ReflectionConstant::getFileName()
Allow determining the name of the file that defined a constant, when the
constant was defined in userland code via const or define(). For constants
defined by PHP core or extensions, false is returned, matching the existing
getFileName() methods on other reflection classes.

Fixes GH-15723
Closes GH-15847
2024-10-31 16:47:45 +01:00
Arnaud Le Blanc
50a3f019dc
Merge branch 'PHP-8.4'
* PHP-8.4:
  Add ReflectionProperty::isLazy()
2024-10-31 14:15:49 +01:00
Arnaud Le Blanc
54a40f3bde
Add ReflectionProperty::isLazy()
Closes GH-16342
2024-10-31 14:14:20 +01:00
Ilija Tovilo
e122152373
Simplify (bitset & flag) == flag conditions
Closes GH-16558
2024-10-30 17:27:52 +01:00
Arnaud Le Blanc
43de8ff19f
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix assertion failure in zend_std_read_property
2024-10-30 12:02:59 +01:00
Arnaud Le Blanc
3d3b22ddf2
Fix assertion failure in zend_std_read_property
We asserted that Z_PROP_FLAG_P(retval) was exactly IS_PROP_UNINIT, but this is a
bit field and it may contain irrelevant bits. For instance it may contain
IS_PROP_REINITABLE during clone, or IS_PROP_LAZY if the object is lazy.

Fixes GH-16615
Closes GH-16639
2024-10-30 12:02:52 +01:00
Christoph M. Becker
836a162089
Don't fiddle with NDEBUG in C code (GH-16511)
* Don't fiddle with NDEBUG in C code

It is way to late to do this in php.h, since assert.h has already been
included.  Even pushing that down to zend_portability.h may not have
the desired effect.  Instead we define or undefine NDEBUG as CFLAG, so
that it works in all circumstances.

As a last resort we fail at build time, if `NDEBUG` is defined when
`ZEND_DEBUG` is enabled.

We also remove the useless workaround in zend_test to include assert.h
again, since that usually won't have any effect anyway.

Co-authored-by: Arnaud Le Blanc <arnaud.lb@gmail.com>
2024-10-27 18:20:59 +01:00
Niels Dossche
0b3684c48e
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16574: Incorrect error "undefined method" messages
2024-10-25 18:33:36 +02:00
Niels Dossche
e9283c0819
Fix GH-16574: Incorrect error "undefined method" messages
The `get_method` object handler may change the object pointer. SPL does
this in its iterator implementations. This causes the error message
to change to another class which is confusing to the user. JIT handles
this correctly. This patch aligns behaviour with JIT.

Closes GH-16576.
2024-10-25 18:33:24 +02:00
Christoph M. Becker
91e6f2621c
Add sanitity checks regarding num_args and arg_info (GH-16538)
`num_args > 0` implies that `arg_info != NULL`.  We explicitly assert
that during compilation and execution to make it easier for developers
to not miss this[1].

[1] <https://github.com/php/php-src/issues/16266>
2024-10-25 15:52:53 +02:00
Tianfeng.Han
4a4371d31c
Modify zend_max_execution_timer.h to export the symbols with C format (#16550) 2024-10-24 16:01:31 +02:00
DanielEScherzer
0b94cf65e4
GH-16067: prevent invalid abstract during compilation of methods (GH-16069)
For classes that are not declared `abstract`, produce a compiler error for any
`abstract` methods. For anonymous classes, since they cannot be made abstract,
the error message is slightly different.

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
2024-10-23 15:04:18 +02:00
Christoph M. Becker
e64e531e3d
Merge branch 'PHP-8.4'
* PHP-8.4:
  Dynamically xfail test case which fails on CI
2024-10-23 13:58:23 +02:00
Christoph M. Becker
7cc327fd5a
Dynamically xfail test case which fails on CI
This is a stop-gap measure for GH-15709 to keep CI green.

Sorry, xfailed the wrong test case previously.
2024-10-23 13:58:07 +02:00
Christoph M. Becker
cfcf39f0e7
Merge branch 'PHP-8.4'
* PHP-8.4:
  Dynamically xfail test case which fails on CI
2024-10-23 13:11:57 +02:00
Christoph M. Becker
bdde797159
Dynamically xfail test case which fails on CI
This is a stop-gap measure for GH-15709 to keep CI green.
2024-10-23 13:11:12 +02:00
Ilija Tovilo
dded6fdcad
Fix gh16508.phpt test expectation
The error changed in master, not 8.4. My bad.
2024-10-22 22:07:03 +02:00
Ilija Tovilo
a4a1c67b9e
Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] Fix test expectation of gh16508.phpt for 8.4+
2024-10-22 15:18:55 +02:00
Ilija Tovilo
5a639c5522
[skip ci] Fix test expectation of gh16508.phpt for 8.4+ 2024-10-22 15:18:24 +02:00
Ilija Tovilo
9fa2f116c3
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix lineno for inheritance errors of early bound classes
2024-10-22 15:17:36 +02:00
Ilija Tovilo
077d69db44
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix lineno for inheritance errors of early bound classes
2024-10-22 15:17:29 +02:00
Ilija Tovilo
e02085359d
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix lineno for inheritance errors of early bound classes
2024-10-22 15:17:11 +02:00
Ilija Tovilo
2d068c4f47
Fix lineno for inheritance errors of early bound classes
Fixes GH-16508
Closes GH-16532
2024-10-22 15:16:43 +02:00
Ilija Tovilo
7862b15679
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix lineno in function redeclaration error
2024-10-22 15:06:12 +02:00
Ilija Tovilo
cd8ee4dad1
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix lineno in function redeclaration error
2024-10-22 15:06:06 +02:00
Ilija Tovilo
381e020edb
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix lineno in function redeclaration error
2024-10-22 15:05:29 +02:00
Ilija Tovilo
de7ef3fa66
Fix lineno in function redeclaration error
We were previously using the lineno of the first instruction, rather than the
start of the function itself.

Fixes GH-16509
Closes GH-16531
2024-10-22 15:04:20 +02:00
Ilija Tovilo
9018d9aa37
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix propagation of ZEND_ACC_RETURN_REFERENCE for call trampoline
2024-10-22 14:49:33 +02:00
Ilija Tovilo
9a093e753a
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix propagation of ZEND_ACC_RETURN_REFERENCE for call trampoline
2024-10-22 14:49:27 +02:00
Ilija Tovilo
5eddcb313e
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix propagation of ZEND_ACC_RETURN_REFERENCE for call trampoline
2024-10-22 14:48:58 +02:00
Ilija Tovilo
8720063c4e
Fix propagation of ZEND_ACC_RETURN_REFERENCE for call trampoline
Fixes GH-16515
Closes GH-16529
2024-10-22 14:47:01 +02:00
Arnaud Le Blanc
96ac2c425f
Merge branch 'PHP-8.4'
* PHP-8.4:
  Lazy objects: Update class constants earlier
2024-10-22 12:20:18 +02:00
Arnaud Le Blanc
64081d1380
Lazy objects: Update class constants earlier
If a lazy object is created for a class whose constants can not be updated, then
we have created an instance of a non-instantiable class. This breaks the
expectations of clone.

Here I ensure that a class has its constants updated before creating a lazy
instance of it.

Fixes OSS-Fuzz #71407
Closes GH-15856
2024-10-22 12:19:31 +02:00
Dmitry Stogov
eef3e5ebca
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16499: [JIT] Undefined to null coercion issues for return
2024-10-21 14:51:52 +03:00
Dmitry Stogov
cfd954f5f9
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16499: [JIT] Undefined to null coercion issues for return
2024-10-21 14:51:41 +03:00
Dmitry Stogov
920e3d6b70
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16499: [JIT] Undefined to null coercion issues for return
2024-10-21 14:51:31 +03:00
Dmitry Stogov
fe513655dc
Fix GH-16499: [JIT] Undefined to null coercion issues for return 2024-10-21 14:50:50 +03:00