Commit graph

1630 commits

Author SHA1 Message Date
Niels Dossche
affffe1122
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix reference support for intltz_get_offset()
2025-04-20 14:23:56 +02:00
Niels Dossche
bf4b470098
Fix reference support for intltz_get_offset()
It should use the helper macros such that types are properly respected.

Closes GH-18364.
2025-04-20 14:23:31 +02:00
Niels Dossche
93826d9556
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Add missing EXTENSIONS section to intl test
2025-03-31 23:05:23 +02:00
Niels Dossche
13d51f895b
Add missing EXTENSIONS section to intl test
[ci skip]
2025-03-31 23:05:15 +02:00
Niels Dossche
fe7f9571d2
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix intl tests for icu 77 (#18125)
2025-03-21 14:25:18 +01:00
Niels Dossche
8823f89a32
Fix intl tests for icu 77 (#18125) 2025-03-21 14:23:03 +01:00
David Carlier
3bb3db5314
Merge branch 'PHP-8.3' into PHP-8.4 2025-03-15 11:37:56 +00:00
David Carlier
005c7b5797
ext/intl: Fix Uconverter::transcode with substitutes as references.
close GH-18059
2025-03-15 11:37:08 +00:00
David Carlier
946408251f
Merge branch 'PHP-8.3' into PHP-8.4 2025-03-15 11:34:30 +00:00
David Carlier
f34859cb90
ext/intl: Fix dateformat_format when the time is an array of references. 2025-03-15 11:33:17 +00:00
David Carlier
7f771e1e87
Merge branch 'PHP-8.3' into PHP-8.4 2025-03-12 22:20:03 +00:00
David Carlier
c3fc94c4b8
ext/intl: fix locale_compose/locale_lookup to be able to deal with references.
close GH-18035
2025-03-12 22:18:34 +00:00
Christoph M. Becker
59ed63732f
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Relax timezone_IDforWindowsID_basic2.phpt expectations
2025-02-02 13:38:36 +01:00
Christoph M. Becker
76fccc2b02
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Relax timezone_IDforWindowsID_basic2.phpt expectations
2025-02-02 13:37:21 +01:00
Christoph M. Becker
036f00f146
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Relax timezone_IDforWindowsID_basic2.phpt expectations
2025-02-02 13:36:39 +01:00
Christoph M. Becker
afe8e2cdff
Relax timezone_IDforWindowsID_basic2.phpt expectations
Apparently, some ICU versions report "America/Los_Angeles" for the `ZZ`
case, what matches the behavior of ICU 76.1 (on Windows).  Possibly,
there has been some bug fix backport on some systems.  Anyhow, either
seems fine, so we're not picky about that.

Closes GH-17669.
2025-02-02 13:35:27 +01:00
David Carlier
05a1c04c43
Merge branch 'PHP-8.3' into PHP-8.4 2025-01-17 22:25:24 +00:00
David Carlier
a1d1269688
Fix GH-17469: UConverter::transcode() not hardcoding error handling.
Respecting instead intl.use_exceptions/intl.error_level.

close GH-17488
2025-01-17 22:23:27 +00:00
Niels Dossche
3240f478bc
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Handle GC cycles properly in intl iterators
2025-01-04 17:49:39 +01:00
Niels Dossche
ee2faaa423
Handle GC cycles properly in intl iterators
This is a follow-up on GH-17343 to implement GC cycle management.
Previously the objects lived too long due to the strong cycle.
This patch adds get_gc handlers to break the cycle.

Closes GH-17355.
2025-01-04 17:42:18 +01:00
Niels Dossche
0ee6691bbc
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-11874: intl causing segfault in docker images
2025-01-03 18:58:36 +01:00
Niels Dossche
a970eefb6c
Fix GH-11874: intl causing segfault in docker images
The segfault happens because zoi->wrapping_obj points to an object that has been freed.
This wrapping_obj is set in IntlIterator_from_StringEnumeration().
Notice how the refcount is not increased in this function.
By switching to ZVAL_OBJ_COPY, the segfault disappears.

We also need to move the responsibility of destroying the iterator to
the iterator itself and keep the object data destruction in the object
destruction. The existing code used a weird recursive destruction
between the iterator and object that was too hard to understand to be
honest. This patch simplifies everything and in the process gets rid of
the leak.

Iterators that are embedded are now responsible for their own
memory cleanup.

Closes GH-17343.
2025-01-03 18:58:15 +01:00
Christoph M. Becker
0f5cc82fa6
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Properly check for required icu4c libraries
2024-12-07 15:11:40 +01:00
Christoph M. Becker
1800cad9d9
Properly check for required icu4c libraries
Besides that just checking for icuuc.lib does not necessarily imply
that the other libraries are available, doing it this way will not copy
the PDBs to the build folder, so these are not available in the debug
packages.  Furthermore, `CHECK_LIB` already adds the library to the
flags, so there is no need to do this manually.

Closes GH-17010.
2024-12-07 15:10:06 +01:00
Christoph M. Becker
54ae770cd6
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Adapt ext/intl tests for ICU 75.1 and 76.1
2024-11-15 18:57:12 +01:00
Christoph M. Becker
716b03d081
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Adapt ext/intl tests for ICU 75.1 and 76.1
2024-11-15 18:55:31 +01:00
Christoph M. Becker
f725f504e8
Adapt ext/intl tests for ICU 75.1 and 76.1
Closes GH-16788.
2024-11-15 18:55:01 +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
845cdbce67
Postpone zend_array_sort() in ext-intl
This function is not ZEND_API yet, so we cannot use it as it won't work for
dynamically linked extensions.
2024-11-04 16:01:00 +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
3245a65034
Adapt ext/intl tests for ICU 76.1
Regarding the test names, see PR #9800.

Closes GH-16660.
2024-11-01 22:21:23 +01:00
Christoph M. Becker
e111bf72d7
Adapt ext/intl tests for ICU 75.1
Closes GH-16616.
2024-10-27 18:17:08 +01:00
DanielEScherzer
db545767e5
Rename ZEND_STR_DEPRECATED to ZEND_STR_DEPRECATED_CAPITALIZED (#15831)
To match other capitalized strings like `ZEND_STR_UNKNOWN_CAPITALIZED` and
`ZEND_STR_ARRAY_CAPITALIZED`. Since this known string was only added in PHP
8.4, no backwards compatibility alias is needed.
2024-09-10 22:45:23 +01: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
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
Christoph M. Becker
0f8259e896
ICU 75.1 requires C++17 (GH-15678)
This needs to be explicitly enabled for MSVC (and probably clang on
Windows); otherwise the default is C++14, which is no longer sufficient
for ICU[1].

While the official PHP 8.4 builds for Windows do not yet use ICU 75.1,
that may change[2].  And even if not, it would be nice for custom
builds to be able to build against ICU 75.1 (or later).

Anyhow, using `std:c++17` is fine for ICU 72.1 which we are currently
using (and likely for some older ICU versions).

[1] <https://github.com/unicode-org/icu/releases/tag/release-75-1>
[2] <https://github.com/winlibs/icu4c/pulls>
2024-08-31 17:01:49 +02:00
Peter Kokot
fbacc0f936
Autotools: Normalize PHP_ADD_BUILD_DIR 1st argument (#15612)
The m4_normalize(m4_expand([$1])) expands the given argument if it
contains M4 macros, and then trims the items together into a space
separated string in an intuitive way.
2024-08-29 00:44:29 +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
Christoph M. Becker
450740cbb6
[skip ci] Fix typos in XFAIL reasons 2024-08-22 11:48:46 +02:00
Gina Peter Bnayard
5853cdb73d Use "must not" instead of "cannot" wording 2024-08-21 21:12:17 +01:00
Gina Peter Bnayard
e7c4d54d65 Use new helper function for "cannot be empty" ValueErrors 2024-08-21 21:12:17 +01:00
Peter Kokot
80d784610a
Add date extension to dependencies (#15475)
This is at this point only meta-data information for extensions to
depend also on date extension. This is a configure phase dependency for
consistency.
2024-08-18 16:47:57 +02:00
Gina Peter Bnayard
a1b1a6c925 [skip ci] Remove dead code 2024-08-17 18:14:47 +02:00
Peter Kokot
42c9963133
Autotools: Quote PHP_CXX_COMPILE_STDCXX macro arguments
[skip ci]
2024-08-09 10:39:16 +02:00
Peter Kokot
1ceadaed52
Autotools: Normalize and quote all PHP_NEW_EXTENSION arguments (#15144)
This adds Autoconf quote characters to all PHP_NEW_EXTENSION arguments
and syncs the CS across the php-src Autotools build system.
2024-07-29 00:14:59 +02:00
Peter Kokot
590786adb3
Autotools: Replace PHP_EXT_DIR with $ext_dir (#15133)
- Sync Autoconf syntax
- The PHP_EXT_DIR macro doesn't accept any arguments and since this is
  called after PHP_NEW_EXTENSION, the $ext_dir variable can be used
  instead.
2024-07-28 10:09:26 +02:00
Peter Kokot
a1b45bb87a
Autotools: Sync PHP_SETUP_* M4 macros (#15117)
- arguments quoted
- MYSQLND_HAVE_SSL help text synced
2024-07-27 11:20:07 +02:00