Commit graph

1642 commits

Author SHA1 Message Date
Niels Dossche
2b383848a7
Fix handling of references in zval_try_get_long()
This API can't handle references, yet everyone keeps forgetting that it
can't and that you should DEREF upfront. Fix every type of this issue
once and for all by moving the reference handling to this Zend API.

Closes GH-18761.
2025-06-04 21:00:05 +02:00
Niels Dossche
cb0b2a27e3
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix memory leak in lookup_loc_range()
2025-06-01 11:38:51 +02:00
Niels Dossche
d39d261b7e
Fix memory leak in lookup_loc_range()
Closes GH-18723.
2025-06-01 11:38:24 +02:00
Niels Dossche
7efe96d504
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix memory leak in intl_datetime_decompose()
2025-05-24 14:56:04 +02:00
Niels Dossche
d6836fb345
Fix memory leak in intl_datetime_decompose()
Closes GH-18635.
2025-05-24 14:55:41 +02:00
Niels Dossche
8d6e377ed8
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Update NEWS for the intl reference fixes
  Fix reference handling of IntlTimeZone::getCanonicalID/intltz_get_canonical_id
  Fix reference handling of grapheme_extract()
  Fix numfmt_parse_currency() reference handling
2025-05-01 10:42:25 +02:00
Niels Dossche
a090e59b37
Fix reference handling of IntlTimeZone::getCanonicalID/intltz_get_canonical_id
Closes GH-18469.
2025-05-01 10:41:32 +02:00
Niels Dossche
e3105f5f1e
Fix reference handling of grapheme_extract()
Closes GH-18471.
2025-05-01 10:40:17 +02:00
Niels Dossche
e3cac07a9b
Fix numfmt_parse_currency() reference handling
Closes GH-18472.
2025-05-01 10:39:53 +02:00
Niels Dossche
173dccb646
Fix IntlDateFormatter::parseToCalendar() reference type system breaks
Closes GH-18440.
2025-04-27 11:33:21 +02:00
Niels Dossche
d00adca199
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  datefmt_parse/datefmt_localtime references type system fixes
  Fix GH-18438: Handling of empty data and errors in ZipArchive::addPattern
2025-04-27 11:32:57 +02:00
Niels Dossche
2beec54e47
datefmt_parse/datefmt_localtime references type system fixes
Closes GH-18441.
2025-04-27 11:31:35 +02:00
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