77 Commits
Author SHA1 Message Date
Gina Peter Banyard c0250bac3a intl: stop including headers as C extern (#24617)
Except for arginfo header as PHP_FUNCTION/PHP_METHOD are marked as U_CFUNC and the `ext/date/php_date.h` header doesn't use extern C.

We now specificy the header symbols that _need_ to follow the C function ABI, meaning in some places we drop U_CFUNC declarations and in others we add it.

Also use the `BEGIN_EXTERN_C()` portability macro when possible so that searching for this is easier.
2026-10-23 21:51:52 +01:00
Weilin Du 7f0dd14b5d ext/intl: Remove dead code (#24292)
This removes some unused functions/macros in the code base,
2026-10-14 00:11:48 +08:00
Weilin Du be3477fc66 ext/intl: Remove icu-io as a dependency (#22891)
This remove the dependency of the ICU IO library in the intl extension.
2026-07-26 22:09:01 +08:00
Weilin Du cff33786f6 ext/intl: add const qualifiers (#22465)
Add several const qualifiers.
2026-06-26 20:34:56 +08:00
Weilin Du eeb12a4e28 ext/Intl: Return PHP_INT_MIN as int from MessageFormatter::parse() on 64-bit (#22131) 2026-05-24 10:41:48 +01:00
Weilin Du 0d7a0a4703 ext/intl: Throw TypeError for non-stringable timezone objects (#21990) 2026-05-09 16:55:26 +01:00
Ben Ramsey bb068359d4 license-update: ext/intl source headers
RFC: https://wiki.php.net/rfc/php_license_update
2026-04-11 21:20:54 -05:00
Marc Bennewitz f4d9ed1368 Use consistent type for h on call zend_hash_index_* (#19255) 2026-04-06 14:39:41 +01:00
Niels Dossche b81f770d39 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  intl: Fix leak in umsg_format_helper()
2025-12-22 12:18:14 +01:00
Niels Dossche 9a7c09c963 intl: Fix leak in umsg_format_helper()
Closes GH-20756.
2025-12-22 12:06:59 +01:00
Gina Peter Banyard 43a91089ca ext/intl: Refactor timezone parameter passing (#19409) 2025-08-08 21:12:43 +01:00
Gina Peter Banyard 6600d0e00f ext/intl: Refactor error handling (#19196)
This is a comprehensive refactoring of the error mechanism of the Intl extension.

By moving the prefixing of the current method/function being executed to actual error message creation by accessing the execution context, we get the following benefits:
- Accurate error messages indicating *what* call caused the error
  - As we *always* "copy" the message, the `copyMsg` arg becomes unused, meaning we can reduce the size of the `intl_error` struct by 4 bytes.
  - Saving it as a zend_string means we know the length of the message
- Remove the need to pass around a "function name" `char*` across multiple calls
- Use Intl's exception mechanism to generate exceptions for constructor call
  - This removes the need for replacing the error handler
  - Which didn't do anything anyway in silent mode, which required throwing non-descriptive exceptions
2025-07-30 16:00:37 +01:00
David CARLIER 690db97c6d intl extension couple of micro optimisations for error edge cases. (#10044)
making c++ compile time few enums ranges.
2023-01-14 07:26:05 +00:00
Christoph M. Becker 1c0dc2a6c9 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8364: msgfmt_format $values may not support references
2022-04-24 12:45:22 +02:00
Christoph M. Becker f5d9e7c031 Fix GH-8364: msgfmt_format $values may not support references
We need to deref any references passed in the `$values` array.  While
we could handle this in the type switch, doing it right away in the
foreach loop makes that more explicit, and also circumvents the missing
range checks for integers which are not passed as int or double.

Closes GH-8407.
2022-04-24 12:43:08 +02:00
Nikita Popov 7742f31f32 Disable workaround for ICU bug on newer versions
This is issue https://unicode-org.atlassian.net/browse/ICU-12584,
which has been fixed in ICU 64.1 by
https://github.com/unicode-org/icu/commit/a9d219691398f0168150ad5a3e5f381f84ca95df.

I'm disabling the workaround for ICU >= 65, as we don't seem to be
doing minor version checks in intl.
2021-05-20 10:10:27 +02:00
KsaR 01b3fc03c3 Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Nikita Popov c61390cfb4 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80425
2020-11-27 10:03:21 +01:00
Nikita Popov 5240f8391f Fixed bug #80425
Rename the methods in MessageFormatAdapter to make sure they don't
clash with anything defined by icu itself, which may be a problem
if icu is linked statically.
2020-11-27 10:02:00 +01:00
Máté Kocsis f00bcfbb7d Generate method entries for ext/intl
Closes GH-5370
2020-04-14 13:39:00 +02:00
Gabriel Caruso 5d6e923d46 Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Nikita Popov a31256d52c Merge branch 'PHP-7.3' into PHP-7.4 2019-09-25 10:34:33 +02:00
Nikita Popov 915fe2fdc6 Merge branch 'PHP-7.2' into PHP-7.3 2019-09-25 10:34:25 +02:00
Jinesh Patel d2331cc3f2 Fix hash key length in umsg_parse_format()
Fix array length passed to zend_hash_str_find_ptr() casting from
UChar array to char array requires mul by sizeof(UChar).
2019-09-25 10:30:33 +02:00
Nikita Popov 77f7ec5152 Fix TimeZone leak in intl MessageFormat
I'm just giving each format a distinct owned object here ... sharing
it looks complicated.
2019-06-25 14:28:58 +02:00
Peter Kokot 92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Anatol Belski 55e0bc9532 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Add test for bug #76942
  Fixed Bug #76942 U_ARGUMENT_TYPE_MISMATCH
2018-10-05 22:53:11 +02:00
Anatol Belski 534684d104 Fixed Bug #76942 U_ARGUMENT_TYPE_MISMATCH
ref bug #74484
2018-10-05 22:50:34 +02:00
Christoph M. Becker 8a4c2f1621 Require ICU ≥ 50.1
Given that ICU is a set of lively developed libraries, that ICU 50.1
has been released on 2012-11-05, and PHP 7.4 is scheduled to be
released seven years after it, we consider it appropriate to ditch
these legacy versions.

Particularly, that would be a reasonable groundwork to implement part
two of the “Deprecate and remove INTL_IDNA_VARIANT_2003” RFC[1], namely
to default idn_to_ascii()'s and idn_to_utf8()'s $variant parameter to
INTL_IDNA_VARIANT_UTS46, which is not defined in ICU < 4.6.

See also the related discussion on internals@[2].

[1] <https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003>
[2] <http://news.php.net/php.internals/101626>ff
2018-09-15 13:59:54 +02:00
Anatol Belski 3cef5a2476 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #74484 MessageFormatter::formatMessage memory corruption
2018-08-09 22:09:21 +02:00
Anatol Belski 45a05f3841 Fixed bug #74484 MessageFormatter::formatMessage memory corruption
with 11+ named placeholder
2018-08-09 22:07:24 +02:00
Dmitry Stogov 0b90cf85a6 Removed "dead" code (zend_hash_update() never fails) 2018-06-01 11:58:57 +03:00
Dmitry Stogov 5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Anatol Belski 08178ed231 Use recommended options for explicit UnicodeString constructors 2018-04-05 13:09:42 +02:00
Anatol Belski d8200e4885 Simplify namespace access
The icu namespace is an alias which resolves to the real namespace.
2018-04-01 01:03:40 +02:00
Anatol Belski 8d35a42383 Utilize the recommended way to handle the icu namespace 2018-03-31 18:51:56 +02:00
Dmitry Stogov ecd2624875 Avoid array duplication and in-place modification 2018-01-17 02:25:36 +03:00
Dmitry Stogov 234306c7ac Cleanup type conversion 2017-12-07 22:34:08 +03:00
Anatol Belski 28b6f66a77 Fixed bug #70484 selectordinal doesn't work with named parameters 2016-04-11 15:01:22 +02:00
Dmitry Stogov f7b6de5b5e Cleanup (avoid string reallocations) 2015-07-01 13:26:39 +03:00
Dmitry Stogov 4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
Stanislav Malyshev b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Stanislav Malyshev 82f3d36583 cleanup intl types 2014-12-29 14:06:12 -08:00
Anatol Belski bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Johannes Schlüter d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Anatol Belski af59e92b24 master renames phase 7 2014-08-25 21:51:49 +02:00
Anatol Belski 4d997f63d9 master renames phase 3 2014-08-25 20:22:49 +02:00
Anatol Belski c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski 888ef26cc5 yet trivial fixes 2014-08-20 22:54:00 +02:00
Anatol Belski 063079b62e ported ext/intl, bugfixes to go 2014-08-19 22:57:17 +02:00