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

20453 Commits

Author SHA1 Message Date
Gina Peter Banyard
d34c840b4e zend_builtin_functions.c: add const qualifiers (#21487) 2026-03-23 11:00:20 +00:00
Gina Peter Banyard
be1ae8ef6f Zend: add const modifiers (#19571) 2026-03-23 10:52:28 +00:00
Ilija Tovilo
cb8d3a27c3 Merge branch 'PHP-8.5'
* PHP-8.5:
  [skip ci] Harden bug74093.phpt
2026-03-22 01:56:48 +01:00
Ilija Tovilo
b0215e9c1b Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  [skip ci] Harden bug74093.phpt
2026-03-22 01:56:44 +01:00
Ilija Tovilo
c52cfaf88b Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Harden bug74093.phpt
2026-03-22 01:56:38 +01:00
Ilija Tovilo
bc8a95e4fb Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Harden bug74093.phpt
2026-03-22 01:56:32 +01:00
Ilija Tovilo
486c09cd68 [skip ci] Harden bug74093.phpt
Rarely fails with "Maximum execution time of 1 seconds exceeded" due to being
too fast. Increase the compared arrays and mark as FLAKY, given this is
inherently dependent on processing speed.
2026-03-22 01:54:55 +01:00
Gina Peter Banyard
f40b356ad9 Use smart_str_append() if we have a zend_string* (#21414) 2026-03-21 17:06:14 +00:00
Arnaud Le Blanc
2e20074310 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20875: Propagate IN_GET guard in get_property_ptr_ptr for lazy proxies
2026-03-20 15:45:55 +01:00
Arnaud Le Blanc
5485f8ee40 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20875: Propagate IN_GET guard in get_property_ptr_ptr for lazy proxies
2026-03-20 15:45:42 +01:00
Ilia Alshanetsky
9ec303edde Fix GH-20875: Propagate IN_GET guard in get_property_ptr_ptr for lazy proxies
zend_std_get_property_ptr_ptr() was the only property handler that did
not propagate the IN_GET guard to the underlying object when forwarding
from a lazy proxy after initialization. This caused __get to be called
on the underlying object when it shouldn't be, leading to assertion
failures.

The same guard-copying pattern already existed in read_property,
write_property, unset_property, and has_property since commit
26f5009e91 (GH-18039).

Also fixes GH-20873 and GH-20854.

Closes GH-20875
2026-03-20 15:44:21 +01:00
Gina Peter Banyard
38cbbee4aa Zend: add const qualifiers to the majority of compare functions (#21304)
This sadly does not include zend_compare() and functions relying on it because the default compare object hook (zend_std_compare_objects()) relies on zend_compare(), and adds recursion protections to OP1.
Thus making it seems difficult or even impossible for zend_compare to take const parameters.
2026-03-19 20:36:19 +00:00
Arshid
a5ffcf3b1a Use zend_string_init_fast() for single-character string creation (#21438) 2026-03-14 10:50:21 +01:00
Ilija Tovilo
80b1ede843 [skip ci] Fix uninitialized fn_flags2 for internal functions
This field is still unused on master, but required for GH-19941.
2026-03-13 20:26:31 +01:00
Gina Peter Banyard
113893b714 Zend: create a IS_VOID type AST rather a string (#21415) 2026-03-11 22:39:09 +00:00
Calvin Buckley
13b83a46cf Bump libtool to serial 63 from 2.5.4 (#21067)
The libtool 1.5.26 is bundled with PHP since the very early days of the
Autotools build system to ease the building process and avoid additional
dependency on the system Libtool. This updates the bundled libtool to
2.5.4 version.

Fixes and implementations:

- Fixed race conditions when building PHP in parallel ("cannot create
  .libs" warnings).
- Implements request https://bugs.php.net/70374 (Update libtool.m4)
- Fixes libtool eating -flto flags.
- Fixes GH-17310 (configure producing errors on macOS)
- Fixes GH-15946 (./configure error when building with NixOS)

Changes:
- Add a script to update autotools files.
- libtool is spread across multiple files; phpize is updated to handle
  this.
- Remove outdated hacks, i.e. for `ar`.
- Remove documentation references to external libtool, as we vendor it.
- `--with-pic` is now `--enable-pic`. Error out on the old flag.
- On macOS linker now uses -undefined dynamic_lookup flag for shared
  extensions and shared embed SAPI (libphp) instead of older
  '-undefined suppress -flat_namespace' combination.

Co-authored-by: Peter Kokot <peterkokot@gmail.com>
2026-03-11 12:37:56 -03:00
Gina Peter Banyard
f93b17076a Zend: inherit interfaces early (#18622)
The primary motivation for this is that this is required for my abstract generic types proof of concept, as the resolving of bound types needs to happen early to properly track the types.

However, there doesn't seem to be a good reason for delaying the inheritance of interfaces.
This approach might even allow us to drop the `iface` parameter of the `interface_gets_implemented()` handler as the interface name is always known.
2026-03-09 21:57:50 +00:00
Gina Peter Banyard
1096ea149a Zend: mark variable as const 2026-03-09 21:41:06 +00:00
Gina Peter Banyard
032e5f6774 Zend: mark arg_info parameters of zend_do_perform_arg_type_hint_check() const 2026-03-09 21:41:06 +00:00
Gina Peter Banyard
2b20627cbc Zend: mark zend_perform_covariant_type_check() as static
This function is not defined in any headers
2026-03-09 21:41:06 +00:00
Gina Peter Banyard
6880a6c49d Zend: mark scope parameter of zend_type_to_string_resolved() const
And propagate const qualifier to use sites of this function.
2026-03-09 21:41:06 +00:00
Gina Peter Banyard
8bff644233 Zend: remove unused scope parameter of add_intersection_type() 2026-03-09 21:41:06 +00:00
Ilija Tovilo
cccc54872a Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix incorrect property_info sizing for locally shadowed trait properties
2026-03-09 13:50:59 +01:00
Ilija Tovilo
ff3f59b5a7 Fix incorrect property_info sizing for locally shadowed trait properties
Previously, static trait properties would always redeclare locally declared
static properties to make sure any inherited property would stop sharing a
common slot with the parent. This would leave holes in property_info, creating
issues for this code:

    zend_hash_extend(&ce->properties_info,
        zend_hash_num_elements(&ce->properties_info) +
        zend_hash_num_elements(&parent_ce->properties_info), 0);

where zend_hash_num_elements(&ce->properties_info) +
zend_hash_num_elements(&parent_ce->properties_info) is supposed to extend the
hash table enough to hold all additional properties coming from parent. However,
if ce->properties_info contains holes this might not be enough, given all parent
properties are appended at nNumUsed.

This could be fixed by further extending the hash table, but we can also avoid
the holes in properties_info completely by not redeclaring trait properties that
are already declared in the target class. This is now possible because traits
are bound before performing parent class inheritance, so if the property is
already present we know it will separate the property slot.

Fixes GH-20672
Closes GH-21358
2026-03-09 13:50:27 +01:00
Petr Sumbera
ce1cadba29 Fix Solaris tests and add nightly CI job
Closes GH-20709
2026-03-04 10:12:03 +01:00
Ilija Tovilo
a83c025730 Use zend_always_inline for frameless function template functions (GH-21316) 2026-03-03 00:20:34 +01:00
ndossche
bfd66bbdf0 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix compile warnings under GCC 15.2.1 (#21320)
  Updated to version 2026.1 (2026a)
2026-03-02 23:13:40 +01:00
ndossche
210704258a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix compile warnings under GCC 15.2.1 (#21320)
2026-03-02 23:12:48 +01:00
Nora Dossche
583be5a8ca Fix compile warnings under GCC 15.2.1 (#21320)
The compiler now infers constness through string functions.
Adhere to that.
It also now warns about using multiplications in conditions.
2026-03-02 23:12:06 +01:00
Ilija Tovilo
073dcf66bb Merge branch 'PHP-8.5'
* PHP-8.5:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:05:28 +01:00
Ilija Tovilo
07e29acbd4 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:05:21 +01:00
Ilija Tovilo
6f91209260 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:05:14 +01:00
Ilija Tovilo
c6ad84fb9e Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:04:24 +01:00
Ilija Tovilo
3a57b4ced5 Add RUN_RESOURCE_HEAVY_TESTS env var
Disable resource-heavy tests by default (>1GB of memory usage), unless the
RUN_RESOURCE_HEAVY_TESTS env variable is set.

Fixes GH-20762
Closes GH-20935
2026-02-27 15:00:35 +01:00
Calvin Buckley
9942f063db PHP-8.4 is now for PHP 8.4.20-dev 2026-02-24 17:50:02 -05:00
Ilija Tovilo
4156b52296 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix preloaded constant erroneously propagated to file-cached script
2026-02-24 17:31:08 +01:00
Ilija Tovilo
8206eb1cb4 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix preloaded constant erroneously propagated to file-cached script
2026-02-24 17:30:14 +01:00
Ilija Tovilo
ec5a1e001d Fix preloaded constant erroneously propagated to file-cached script
Since GH-15021 preloaded constants are propagated to compiled scripts. This is
problematic for file cache, which assumes all referenced zvals are either
persistently allocated or local to the current script. However, preloaded
constants live in shm as immutable, but not persistent.

To solve this, we'd need to duplicate propagated constants in the optimizer when
file cache is used. This is error prone given it needs to happen in many places.
It's debatable whether constant propagation is even correct in this case, as
running the preloaded script on a restart isn't guaranteed to produce the same
result.

Hence, avoid the issue for now by just not relying on preloaded symbols when
file cache is used.

Fixes GH-21052
Closes GH-21281
2026-02-24 17:28:56 +01:00
Daniel Scherzer
ee1e5f295d PHP-8.5 is now for PHP 8.5.5-dev 2026-02-24 11:10:09 -05:00
Arshid
3b609a14e5 Zend: Replace RETVAL_TRUE/RETVAL_FALSE with RETVAL_BOOL (#21277) 2026-02-23 20:32:14 +00:00
Ilija Tovilo
94c8e01a06 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix borked SCCP of array containing partial object
2026-02-17 18:12:15 +01:00
Ilija Tovilo
1da4480852 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix borked SCCP of array containing partial object
2026-02-17 18:12:09 +01:00
Ilija Tovilo
1931472f22 Fix borked SCCP of array containing partial object
In SCCP, arrays containing partial objects must be marked as partial so that
their values are not accidentally propagated.

Fixes GH-21227
Closes GH-21232
2026-02-17 18:11:28 +01:00
Tim Düsterhus
303104e2bf zend: Define C23 enum zend_class_type (#21241)
Checked for “binary and” comparisons using Coccinelle:

    @@
    struct _zend_class_entry *e;
    expression x;
    @@

    * (e->type & x)

    @@
    zend_class_entry *e;
    expression x;
    @@

    * (e->type & x)
2026-02-17 16:49:45 +01:00
Gina Peter Banyard
b65ccc08dd zend_ini: refactor zend_ini_boolean_displayer_cb 2026-02-16 13:34:25 +00:00
Gina Peter Banyard
d2710685dd zend_ini: add const qualifiers 2026-02-16 13:34:25 +00:00
Gina Peter Banyard
30c09fff62 zend_ini: use SUCCESS instead of 0 to compare return value of function returning zend_result 2026-02-16 13:34:25 +00:00
Gina Peter Banyard
c2a9571357 zend_ini: Use true/false rather than 1/0 for bool arguments 2026-02-16 13:34:25 +00:00
Gina Peter Banyard
ed67072893 zend_ini: use bool type instead of uint8_t type 2026-02-16 13:34:25 +00:00
Gina Peter Banyard
e35b381564 zend_ini: use bool type instead of int type 2026-02-16 13:34:25 +00:00